no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | monitors:nfs [2012/02/29 21:33] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== nfs ====== | ||
| + | |||
| + | ^ Author | [[ michael.adelmann@gmail.com | mikadel ]] | | ||
| + | ^ Compatibility | Xymon 4.3.0 | | ||
| + | ^ Requirements | Linux/Unix, killdog | | ||
| + | ^ Download | None | | ||
| + | ^ Last Update | 2012-01-03 | | ||
| + | |||
| + | ===== Description ===== | ||
| + | |||
| + | This is a shell script that is able to monitor NFS shares(/ | ||
| + | |||
| + | ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | This test needs to be configurated via a config file (feel free to change its' name or location). A correctly mounted nfs share is shown as green entry, failures are represented by a red entry and not responding shares (which means that the ' | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | === Client side === | ||
| + | |||
| + | Create the following files in your xymon client directory: | ||
| + | |||
| + | monitoring script: < | ||
| + | |||
| + | monitoring config: < | ||
| + | |||
| + | xymon monitor config: < | ||
| + | |||
| + | ' | ||
| + | |||
| + | hobbit ALL=NOPASSWD:/< | ||
| + | |||
| + | === Server side === | ||
| + | |||
| + | None. | ||
| + | |||
| + | ===== Source ===== | ||
| + | ==== killdog ==== | ||
| + | |||
| + | <hidden onHidden=" | ||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | PID="" | ||
| + | |||
| + | function check() { | ||
| + | " | ||
| + | |||
| + | PID=" | ||
| + | } | ||
| + | |||
| + | function watchdog() { | ||
| + | RES=`ps -ef | grep " | ||
| + | if [ -z " | ||
| + | exit | ||
| + | else | ||
| + | sleep $1 | ||
| + | echo " | ||
| + | kill $PID 2>/ | ||
| + | fi | ||
| + | } | ||
| + | |||
| + | # main | ||
| + | check " | ||
| + | watchdog " | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ==== nfs ==== | ||
| + | |||
| + | <hidden onHidden=" | ||
| + | < | ||
| + | #!/bin/bash | ||
| + | |||
| + | COLOR=" | ||
| + | COLUMN=" | ||
| + | COMMAND="/ | ||
| + | CONFIG=" | ||
| + | MSG="" | ||
| + | # read config file | ||
| + | source $CONFIG | ||
| + | |||
| + | |||
| + | RESULT=`$COMMAND " | ||
| + | |||
| + | for MP in " | ||
| + | do | ||
| + | CONTENT=`echo -e " | ||
| + | |||
| + | if [ -n " | ||
| + | if [ -n "`echo -e $CONTENT | grep \" | ||
| + | MSG=`echo -e " | ||
| + | else | ||
| + | MSG=`echo -e " | ||
| + | fi | ||
| + | else | ||
| + | COLOR=" | ||
| + | MSG=`echo -e " | ||
| + | fi | ||
| + | done | ||
| + | |||
| + | $BB $BBDISP " | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ==== nfs.cfg ==== | ||
| + | |||
| + | <hidden onHidden=" | ||
| + | < | ||
| + | [nfs] | ||
| + | ENVFILE / | ||
| + | CMD $HOBBITCLIENTHOME/ | ||
| + | LOGFILE / | ||
| + | INTERVAL 5m | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ==== nfs.conf ==== | ||
| + | |||
| + | <hidden onHidden=" | ||
| + | < | ||
| + | # nfs test configuration | ||
| + | |||
| + | # mount points to check | ||
| + | MOUNT[0]="/ | ||
| + | MOUNT[1]="/ | ||
| + | |||
| + | # timeout in seconds | ||
| + | TIMEOUT=5 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== Known Bugs and Issues ===== | ||
| + | None currently known. | ||
| + | ===== To Do ===== | ||
| + | |||
| + | ===== Credits ===== | ||
| + | |||
| + | ===== Changelog ===== | ||
| + | |||
| + | * **2012-01-03** | ||
| + | * Initial release | ||