Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tips [2017/07/07 00:58] – created wikiadmin | tips [2017/07/07 03:29] (current) – wikiadmin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Coming Soon ====== | + | < |
+ | <panel title="What do the little red/ | ||
+ | |< 60% >| | ||
+ | ^ | ||
+ | ^ Green: Status OK | {{: | ||
+ | ^ Yellow: Warning | ||
+ | ^ Red: Critical | ||
+ | ^ Clear: No data | {{: | ||
+ | ^ Purple: No report | {{: | ||
+ | ^ Blue: Disabled | ||
+ | </ | ||
+ | <panel title=" | ||
+ | Did you install a client? The Xymon client package is installed automatically only on the Xymon server - on other systems, you must build the client package by running Xymon' | ||
+ | |||
+ | If you did install a client, then the two most probable causes for this are: | ||
+ | |||
+ | * The client is using another hostname than what is in the hosts.cfg file.\\ Xymon only cares about the hosts that are in the hosts.cfg file, and discards status-reports from unknown hosts. If you check the " | ||
+ | * A firewall is blocking the client access to the Xymon server. \\ Clients must be able to connect to the Xymon server on TCP port 1984 to send their status reports. If this port is blocked by a firewall, client status reports will not show up. \\ If possible, open up the firewall to allow this access. Alternatively, | ||
+ | Other methods are also possible, e.g. bbfetch (available from the www.deadcat.net archive. | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Add a CLIENT: | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | They have been integrated into the Xymon network daemon. See the next three questions. | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | I accidentally added an ' | ||
+ | |||
+ | Use the command | ||
+ | < | ||
+ | ~/ | ||
+ | </ | ||
+ | to permanently remove all traces of a test. Note that you need the quotes around the "drop HOSTNAME ftp". | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | First, remove the host from the // | ||
+ | < | ||
+ | ~/ | ||
+ | </ | ||
+ | to permanenly remove all traces of a host. Note that you need the quotes around the "drop HOSTNAME" | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | First, change the // | ||
+ | < | ||
+ | ~/ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Charles Jones provided this recipe on the Xymon mailing list: | ||
+ | |||
+ | < | ||
+ | From: Charles Jones | ||
+ | Date: Sun, 06 Feb 2005 21:28:19 -0700 | ||
+ | Subject: Re: [hobbit] Apache tag | ||
+ | |||
+ | Okay, first you must make the indicated addition to your apache | ||
+ | httpd.conf (or you can make a xymon.conf in apaches conf.d directory). | ||
+ | [ed: See the hosts.cfg man-page for the " | ||
+ | |||
+ | Then, you must restart apache for the change to take effect | ||
+ | (/ | ||
+ | |||
+ | Then, manually test the server-stats url to make sure it's working, by | ||
+ | using your browser and going to | ||
+ | http:// | ||
+ | http:// | ||
+ | performance info). | ||
+ | |||
+ | Total Accesses: 131577 | ||
+ | Total kBytes: 796036 | ||
+ | CPULoad: 1.0401 | ||
+ | Uptime: 21595 | ||
+ | ReqPerSec: 6.09294 | ||
+ | BytesPerSec: | ||
+ | BytesPerReq: | ||
+ | BusyWorkers: | ||
+ | IdleWorkers: | ||
+ | |||
+ | Scoreboard: RR__RWR___RR_R_RR_RRRRRRRRR_RRRRRRR__RRR_RRRRCRRRRR_RRRR........................................................................................................................................................................................................ | ||
+ | |||
+ | Now, assuming you are getting back the server-status info, time to make | ||
+ | sure your hosts.cfg is correctly configured to collect and graph the | ||
+ | data. Heres what I have in mine: | ||
+ | |||
+ | 1.2.3.4 | ||
+ | |||
+ | From what you said of your setup, I'm guessing your only problem is | ||
+ | using the wrong url for the apache tag (you used | ||
+ | " | ||
+ | kind of URL you would use for the http tag). | ||
+ | |||
+ | Hope this helped. | ||
+ | |||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | There is a [[https:// | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | The // | ||
+ | |||
+ | Note that if you run the __// | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Edit the file server/ | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Configure your alerts in server/ | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | A common Apache configuration mistakenly believes any filename containing " | ||
+ | < | ||
+ | This occurs because by default, apache associates the cgi-script | ||
+ | | ||
+ | by changing the following line in my httpd.conf | ||
+ | |||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Xymon by default uses the system **mail** command to send out messages. The mail-command in Solaris and HP-UX does not understand the "-s SUBJECT" | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Not directly, but there is other Open Source software available that can handle SNMP traps. A very elegant method of feeding traps into Xymon has been described in [[http:// | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | Anything that can be automated via a script or a custom program can be added into Xymon. A lot of extension scripts are available for Big Brother at the www.deadcat.net archive, and these will typically work without modifications if you run them in Xymon. Sometimes a few minor tweaks are needed - the Xymon mailing list can help you if you don't know how to go about that. | ||
+ | |||
+ | But if you have something unique you need to test, writing an extension script is pretty simple. You need to figure out some things: | ||
+ | |||
+ | * What name will you use for the column? | ||
+ | * How will you test it? | ||
+ | * What criteria should decide if the test goes red, yellow or green? | ||
+ | * What extra data from the test will you include in the status message? | ||
+ | |||
+ | A simple **client-side** extension script looks like this: | ||
+ | < | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | # Do whatever you need to test for something | ||
+ | # As an example, go red if / | ||
+ | if test -f / | ||
+ | then | ||
+ | COLOR=red | ||
+ | MSG=" | ||
+ | |||
+ | `cat / | ||
+ | " | ||
+ | else | ||
+ | MSG=" | ||
+ | |||
+ | All is OK | ||
+ | " | ||
+ | fi | ||
+ | |||
+ | # Tell Xymon about it | ||
+ | | ||
+ | |||
+ | | ||
+ | " | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | You will notice that some environment variables are pre-defined: | ||
+ | |||
+ | To run this, save your script in the // | ||
+ | |||
+ | < | ||
+ | | ||
+ | ENVFILE $XYMONCLIENTHOME/ | ||
+ | CMD $XYMONCLIENTHOME/ | ||
+ | LOGFILE $XYMONCLIENTHOME/ | ||
+ | INTERVAL 5m | ||
+ | </ | ||
+ | |||
+ | **Server-side scripts** look almost the same, but they will typically use the [[https:// | ||
+ | |||
+ | < | ||
+ | # | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | do | ||
+ | set $L # To get one line of output from xymongrep | ||
+ | |||
+ | HOSTIP=" | ||
+ | MACHINEDOTS=" | ||
+ | MACHINE=`echo $2 | $SED -e' | ||
+ | |||
+ | COLOR=green | ||
+ | MSG=" | ||
+ | |||
+ | #... do the test, perhaps modify COLOR and MSG | ||
+ | |||
+ | $XYMON $XYMSRV " | ||
+ | |||
+ | ${MSG} | ||
+ | " | ||
+ | done | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | Note that for server side tests, you need to loop over the list of hosts found in the hosts.cfg file, and send one status message for each host. Other than that, it is just like the client-side tests. | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | The menu system uses the CSS " | ||
+ | |||
+ | In the // | ||
+ | <span class=" | ||
+ | </ | ||
+ | |||
+ | <panel title=" | ||
+ | If you cannot install any " | ||
+ | |||
+ | **Perl version:** | ||
+ | <code perl> | ||
+ | # | ||
+ | # | ||
+ | sub sendToXymon { | ||
+ | use IO::Socket; | ||
+ | my($server, | ||
+ | my $response; | ||
+ | my $sock = new IO:: | ||
+ | PeerAddr => $server, | ||
+ | PeerPort => $port, | ||
+ | Proto => ' | ||
+ | ); | ||
+ | die "Could not create socket: $!\n" unless $sock; | ||
+ | print $sock $msg; | ||
+ | shutdown($sock, | ||
+ | while ($response=< | ||
+ | { | ||
+ | print " | ||
+ | } | ||
+ | close($sock); | ||
+ | } | ||
+ | |||
+ | $host = $ARGV[0]; | ||
+ | if ($#ARGV != 2) { | ||
+ | $port = 1984; | ||
+ | $msg = $ARGV[1]; | ||
+ | } | ||
+ | else { | ||
+ | $port = $ARGV[1]; | ||
+ | $msg = $ARGV[2]; | ||
+ | } | ||
+ | |||
+ | sendToXymon($host, | ||
+ | </ | ||
+ | |||
+ | **BASH version:** | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | HOST=" | ||
+ | if test $# -gt 1; then | ||
+ | PORT=" | ||
+ | shift | ||
+ | else | ||
+ | PORT=" | ||
+ | fi | ||
+ | MSG=" | ||
+ | |||
+ | exec 3<>/ | ||
+ | echo " | ||
+ | |||
+ | exit 0 | ||
+ | </ | ||
+ | |||
+ | NOTE: The BASH support for using TCP sockets may be disabled at compile-time - some believe it is a security risk to have such an easy way of doing network I/O without requiring any special tools. | ||
+ | |||
+ | **Bourne / Korn shell (requires telnet):** | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | HOST=" | ||
+ | if test $# -gt 1; then | ||
+ | PORT=" | ||
+ | shift | ||
+ | else | ||
+ | PORT=" | ||
+ | fi | ||
+ | MSG=" | ||
+ | |||
+ | ( echo " | ||
+ | </ | ||
+ | |||
+ | Both of these take 2 or 3 parameters: The Xymon host (hostname or IP-address), | ||
+ | |||
+ | Oyvind Bjorge provided the core of the Perl script, and Jeremy Laidman provided the core of the shell-scripts in [[http:// | ||
+ | </ | ||
+ | </ |