Page 2 of 2

Re: use new plugin on my clients

Posted: Thu Sep 22, 2016 4:21 pm
by baber
rkennedy wrote:Here's an example -

Code: Select all

[root@localhost libexec]# ./check_ping -H baber.com -w 100.0,20% -c 500.0,60%
PING OK - Packet loss = 0%, RTA = 71.87 ms|rta=71.873001ms;100.000000;500.000000;0.000000 pl=0%;20;60;0
You still have not posted your host definition for nn.

this is my nagios.cfg file

Code: Select all

define service{
        use                            generic-service
        host_name                      nagios
        service_description            Temprature Fan Power
        check_command                  check_nrpe!check_my_hplog
}

define service{
        use                             generic-service      
        host_name                       nagios
        service_description             PING
        check_command                   check_ping!100.0,20%!500.0,60%
        }

define service{
        use                     generic-service
        host_name               nagios
        service_description     RunLevel
        check_command           check_nrpe!check_my_runlevel      
  }

define service{
        use                     generic-service
        host_name               nagios
        service_description     Permision
        check_command           check_nrpe!check_my_perm      
  }


but now i want ping 10.1.1.1 from nagios server when i run this on nagios server is ok

Code: Select all

./check_ping -H 10.4.13.39 -w 100.0,20% -c 500.0,60%
PING OK - Packet loss = 0%, RTA = 0.53 ms|rta=0.531000ms;100.000000;500.000000;0.000000 pl=0%;20;60;0
but when i add this line to nagios.cfg file

Code: Select all

define service{
        use                             generic-service      
        host_name                       nagios
        service_description             ILO 
        check_command                   check_ping -H 10.1.1.1 -w 100.0,20% -c 500.0,60%
        }
when want restart nagios service this error appear

Code: Select all

Checking objects...
Error: Service check command 'check_ping -H 10.1.1.1 -w 100.0,20% -c 500.0,60%' specified in service 'ILO' for host 'nagios' not defined anywhere!


Re: use new plugin on my clients

Posted: Thu Sep 22, 2016 4:28 pm
by Box293

Code: Select all

define command {
       command_name                  		check_ping_alt
       command_line                  		$USER1$/check_ping -H $ARG1$ -w $ARG2$ -c $ARG3$ -p 5
}

    define service{
            use                             generic-service     
            host_name                       nagios
            service_description             ILO
            check_command                   check_ping_alt!10.1.1.1!100.0,20%!500.0,60%
            }

You'll need a custom command and then configure the service to point to that command.