Page 1 of 1

use check_by_ssh plugin

Posted: Sat Dec 03, 2016 11:39 am
by baber
dear all
Hi



now for example with nrpe i use check_disk with this method :

add this to nrpe.cfg

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$  

and in service.cfg file for that host add this

Code: Select all

   check_command           check_nrpe!check_disk!'-w 20% -c 10 -W 20% -K 10 -e -A -i /net -i /var/named'
but wheni want use check_ny_ssh

in command.cfg file on nagios server i have added this line

Code: Select all

define command{
        command_name    check_disk
        command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -C '/usr/local/nagios/libexec/check_disk -w $ARG2$ -c $ARG3$ -p $ARG4$ '
}
 
in service.cfg file added this

Code: Select all

define service{
        use                     local-service
        host_name               NAG
        service_description     DISk Space
        check_command           check_disk!22!20%!10%!/
        }
but i want it automatically detect all of my file system such as nrpe here i have to add each file system such as / , /usr , /var manually ?

please see attach pic it can just monitor / filesystem

Re: use check_by_ssh plugin

Posted: Sat Dec 03, 2016 3:57 pm
by ruffsense

Code: Select all

check_by_ssh -H $HOSTADDRESS$ -C "/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$"

Re: use check_by_ssh plugin

Posted: Mon Dec 05, 2016 3:05 pm
by ssax
Does the one just posted (utilizing $ARG1$) work for you or are you still having issues when running it through check_by_ssh?