Using check_by_ssh

Brenckle, Nicholas NBrenckle at dsl.net
Thu Mar 3 17:07:27 CET 2005


Is there any way to use check_by_ssh to stack checks onto one connection? I
am able to use it just fine for one server/one check as follows:
 
[root at nagios-server libexec]# ./check_by_ssh -l nagios -H nagios-client -C
'~/bin/check_disk -c 3% -w 5%'
DISK OK - free space: / 770 MB (76%); /boot 79 MB (82%); /dev/shm 504 MB
(100%); /tmp 230 MB (93%); /u00 90092 MB (95%); /usr 928 MB (46%);
/usr/local 1881 MB (93%); /var 735 MB (73%);| /=237MB;956;976;0;1007
/boot=18MB;91;93;0;96 /dev/shm=0MB;477;487;0;503 /tmp=16MB;233;238;0;246
/u00=4855MB;90199;92098;0;94947 /usr=1087MB;1914;1954;0;2015
/usr/local=134MB;1914;1954;0;2015 /var=273MB;956;976;0;1007

Fine right? Sure, works great. Plugged that into my checkcommands.cfg and
restarted nagios. Perfect. But why use one ssh connection for disk, then
another for CPU load, another for procs, etc, when check_by_ssh can stack as
follows?
 
[root at nagios-server libexec]# ./check_by_ssh -l nagios -H nagios-client -n
nagios-client -s disk:procs -C '~/bin/check_disk -c 3% -w 5%' -C
'~/bin/check_procs'
DISK OK - free space: / 770 MB (76%); /boot 79 MB (82%); /dev/shm 504 MB
(100%); /tmp 230 MB (93%); /u00 90092 MB (95%); /usr 928 MB (46%);
/usr/local 1881 MB (93%); /var 735 MB (73%);| /=237MB;956;976;0;1007
/boot=18MB;91;93;0;96 /dev/shm=0MB;477;487;0;503 /tmp=16MB;233;238;0;246
/u00=4855MB;90199;92098;0;94947 /usr=1087MB;1914;1954;0;2015
/usr/local=134MB;1914;1954;0;2015 /var=273MB;956;976;0;1007

Thats no good, I only get one line... Well I can put the output to a file...
 
[root at nagios-server libexec]# ./check_by_ssh -l nagios -H nagios-client -n
nagios-client -s disk:procs -C '~/bin/check_disk -c 3% -w 5%' -C
'~/bin/check_procs' -O /tmp/test.ssh
[root at nagios-server libexec]# more /tmp/test.ssh
[1109865310] PROCESS_SERVICE_CHECK_RESULT;nagios-client;disk;0;DISK OK -
free sp
ace: / 770 MB (76%); /boot 79 MB (82%); /dev/shm 504 MB (100%); /tmp 230 MB
(93%
); /u00 90092 MB (95%); /usr 928 MB (46%); /usr/local 1881 MB (93%); /var
735 MB
 (73%);| /=237MB;956;976;0;1007 /boot=18MB;91;93;0;96
/dev/shm=0MB;477;487;0;503
 /tmp=16MB;233;238;0;246 /u00=4855MB;90199;92098;0;94947
/usr=1087MB;1914;1954;0
;2015 /usr/local=134MB;1914;1954;0;2015 /var=273MB;956;976;0;1007
[1109865310] PROCESS_SERVICE_CHECK_RESULT;nagios-client;procs;0;PROCS OK: 42
pro
cesses
 
Cool! Well, that doesnt help me get that info INTO the nagios report. The
result of putting this into my checkcommands.cfg shows only the first
check/result (in this case, disk) with no mention or anything of the proc
check.
 
Is there any way to get the multiple results into nagios without having to
do multiple ssh connections, one for each check?
 
-Nick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050303/9e4a7748/attachment.html>


More information about the Users mailing list