I use check_by_ssh plugin because I need to do some check on remote machines over encrypted tunnel.
I'd like to execute remote scripts and grab their output. Unfortunatly the plugin return only return codes of script execution: 0,1,2 according to Nagios plug-in development guidelines
For example I have a script monitoring only set of filesystems on remote UNIX machine. The perl script has a config file on the remote.
The multiline output (each line for every filesystem) is generated only for overloaded filesystems as below:
Test_ID Bussiness_system_name Service_name Severity Text_message_with_percent_value_and_filesystem_name
For not fullfilled filesystem no output is generated then if everything works fine, there's no output.
When I run the script from shell console on nagios server, everything is OK. Executed this way
Code: Select all
/usr/local/nagios/libexec/check_by_ssh -H 10.10.65.30 -C "export CHKHOME=/opt/my_agt ; /opt/my_agt/var/bin/NAG_disk_space.pl" -l chkusername -EI prefer using scripts with local configs instead of scripts run via SSH with parameters defined on Nagios server.
It is better approach, because I can only display filesystems with problems with one Nagios command. To use mentioned plugin I should modify the script to accept such parameters: filesystem name, critical and warning value. That scenario is more complicated and has many service entries for only one host. I prefer summarizing them to one entity: filesystems on that host.
Do you know any workarounds or resolutions
Is it whatever possible to parse many lines of Nagios checks?
Filesystems are only example of approach, I need to do another tests on processes or file existence tests.
THX.