The IT Monitor server (“monitorsrv”) is controlled via preferences (see 8 “Preferences”), which allow setting conditions when alarms will be sent off to specified e-mail addresses.
If a single condition for setting off the alarm is met, a so-called “Push Notification” is sent to all iPhones that monitor this server. In addition, “monitorsrv” administers a list of e-mail addresses to which the alarm notification is sent. This list can be edited from the iPhone. By default this list is empty.
“monitorsrv” needs not be installed on the server running the services that are subject to observation (see 4.3 “IT Monitor observed services”).
The IT Monitor Server service port is 2029.
Issue the command socket localhost 2029
, type
help
for the command overview and quit
to leave.
List available commands.
Print help on a command.
Close the connection to IT Monitor Server.
Log in to the IT Monitor Server (required e.g. for stat).
Usage: login <user> <password>
login hendrik secret ready.
Connect to a different IT Monitor Server.
remote turtle.helios.de IT Monitor Server 1.0.0 (2.0/macosx86) running on "turtle" ready.
Show server name.
name ankh.helios.de ready.
Show list of connected client.
clients The following machines are connected: 172.16.2.89 172.16.2.93 ready.
Show time range of recorded statistics.
range time range: 05.05.2014 09:53:20 11.09.2014 13:21:54 ready.
Set the output format for the statistics records:
1 | Plain text | |
2 | XML | |
3 | Internal format used by IT Monitor app |
format 2 ready.
Get accumulated statistics (authorization via login required).
Usage: stat <start (UNIX “time_t”)> <end (UNIX “time_t”)><numSamples>
stat 1399248000 1409875200 8 "record time cpu-usage cpu-alert memory-usage memory-paging network-packets disk-alert user-system user-helios jobs-print jobs-opi jobs-script jobs-tool jobs-index" {1 1399248000 8.7 1 60.6 20 13 0 3 3 4 0 0 0 0} {2 1400766171 9.4 1 59.7 23 18 0 3 3 3 0 0 0 0} {3 1402284342 9.0 1 63.3 24 14 0 3 3 3 0 0 0 1} {4 1403802514 9.5 1 62.7 29 16 0 4 5 4 0 0 0 704} {5 1405320685 6.1 0 56.3 19 16 0 4 6 4 1 0 0 0} {6 1406838857 7.4 1 63.7 30 32 0 4 5 4 33 0 0 246} {7 1408357028 0.0 0 0.0 0 0 0 0 0 0 0 0 0 0} {8 1409875200 0.0 0 0.0 0 0 0 0 0 0 0 0 0 0} ready.
The number of system messages on a host can rapidly increase, depending on the server traffic. In order to filter all messages for the desired information, IT Monitor Server allows setting up filter scripts which can reduce the amount of system messages significantly. IT Monitor Server allows two approaches to filter messages on the IT Monitor server:
The “prefilter.pl” script allows filtering system messages for specified messages, e.g. info, errors, before they are written to the database.
The “postfilter.pl” script allows filtering system messages for specified messages after they have been requested from the database. In this case, the filtered messages are not displayed on the iOS device.
Both filter scripts must be created and set up by the customer, and stored in “var/monitorsrv”.
It is necessary to create the “monitorsrv” subdirectory.
The “prefilter.pl” script:
#!/usr/bin/perl use strict; while (<>) { # postfix stuff next if /postfix\/smtp/; next if /postfix\/smtpd/; next if /postfix\/qmgr/; next if /postfix\/cleanup/; next if /postfix\/anvil/; next if /postfix\/bounce/; next if /postfix\/scache/; # login/logout users next if /pam_unix/ and /session opened for user/; next if /pam_unix/ and /session closed for user/; # Test for skipping lines next if /skip/; print; }
Make sure that the first line does really point to an existing Perl
binary. On Windows, you may just use “Perl” because it should be in the
environment PATH
.
You may remove the unneeded “next if ...” lines which are just shown as an example here.
After the Perl script has been saved (or modified later) “monitorsrv” needs to be restarted.
You can verify this script using “psyslog”, e.g.:
psyslog -t "testing" "bing" psyslog -t "testing" "bing skip me" psyslog -t "testing" "bum"
If the script works properly the line (... bing skip me
) should
not be listed in the IT Monitor app.