Page 4 of 12

Re: check_nrpe

Posted: Thu Dec 10, 2015 3:47 pm
by nebblkshts
Yes it is.

Re: check_nrpe

Posted: Fri Dec 11, 2015 1:18 pm
by hsmith
Can you post the commands.cfg in it's current state?

Re: check_nrpe

Posted: Fri Dec 11, 2015 1:51 pm
by nebblkshts

Code: Select all

###############################################################################
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS
###############################################################################


################################################################################
# NOTIFICATION COMMANDS
################################################################################


#notify-host-by-email' command definition
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "$NOTIFICATIONTYPE$ Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$ -- -f [email protected]
        }

# 'notify-service-by-email' command definition
define command{
        command_name    notify-service-by-email
        command_line    /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mailx -s "$NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$ -- -f [email protected]
        }


#notify-host-by-cellphone' command definition
define command{
        command_name    notify-host-by-cell
        command_line    /usr/bin/printf "%b" "Host $HOSTNAME$ is $HOSTSTATE$\nInfo: $HOSTOUTPUT$" | /usr/bin/mailx -s Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTEMAIL$
        }

# 'notify-service-by-cellphone' command definition
define command{
        command_name    notify-service-by-cell
        command_line    /usr/bin/printf "%b" "Service: $SERVICEDESC$ on Host $HOSTALIAS$ is $SERVICESTATE$\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mailx -s "Service $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
        }

################################################################################
# HOST CHECK COMMANDS
################################################################################

# On Debian, check-host-alive is being defined from within the
# nagios-plugins-basic package

################################################################################
# PERFORMANCE DATA COMMANDS
################################################################################

# 'process-host-perfdata' command definition
define command{
        command_name    process-host-perfdata
        command_line    /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/lib/nagios3/host-perfdata.out
        }


# 'process-service-perfdata' command definition
define command{
        command_name    process-service-perfdata
        command_line    /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/lib/nagios3/service-perfdata.out
        }

#The Following has been imported from the old Nagios Install:


#NRPE Definition
#define command{
#        command_name check_nrpe
#        command_line ./usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 20
#}

# 'check_ups' command definition
define command{
        command_name    check_ups
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
        }

# 'check_local_disk' command definition
define command{
        command_name    check_local_disk
        command_line    $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
        }

# 'check_local_load' command definition
define command{
        command_name    check_local_load
        command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
        }

# 'check_local_procs' command definition
define command{
        command_name    check_local_procs
        command_line    $USER1$/check_procs -w $ARG1$ -c $ARG2$ -C $ARG3$
        }

# 'check_local_users' command definition
define command{
        command_name    check_local_users
        command_line    $USER1$/check_users -w $ARG1$ -c $ARG2$
        }

# 'check_local_swap' command definition
define command{
        command_name    check_local_swap
                command_line    $USER1$/check_swap -w $ARG1$ -c $ARG2$
        }

# 'check_local_mrtgtraf' command definition
define command{
        command_name    check_local_mrtgtraf
        command_line    $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
        }
# 'check_ftp' command definition
#define command{
#        command_name    check_ftp
#        command_line    $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
#        }

# 'check_hpjd' command definition
#define command{
#        command_name    check_hpjd
#        command_line    $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
#        }

# 'check_snmp' command definition
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
        }

# 'check_http' command definition
#define command{
#        command_name    check_http
#        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
#        }

# 'check_ssh' command definition
#define command{
#        command_name    check_ssh
#        command_line    $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
#        }

# 'check_dhcp' command definition
#define command{
#        command_name    check_dhcp
#        command_line    $USER1$/check_dhcp $ARG1$
#        }

# 'check_ping' command definition
#define command{
#        command_name    check_ping
#        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
#        }

# 'check_pop' command definition
#define command{
#        command_name    check_pop
#        command_line    $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
#        }

# 'check_imap' command definition
#define command{
#        command_name    check_imap
#        command_line    $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
#        }

# 'check_smtp' command definition
#define command{
#        command_name    check_smtp
#        command_line    $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
#        }

# 'check_tcp' command definition
#define command{
#        command_name    check_tcp
#        command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
#        }

# 'check_udp' command definition
#define command{
#        command_name    check_udp
#        command_line    $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
#        }

# 'check_nt' command definition
#define command{
#        command_name    check_nt
#        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
#        }

## Check if the JABBER service is alive (default port=5222)
# 'check_jabber' command definition

define command {
     command_name    check_jabber
     command_line    $USER1$/check_jabber -H $HOSTADDRESS$ -p 5222 -e 'xmlns="jabber:client" from="gd.com"'

}


define command{
 command_name check_snmp_printer
 command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$

Re: check_nrpe

Posted: Fri Dec 11, 2015 2:09 pm
by hsmith
Currently there is no check_nrpe command definition...

So, if we add

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
You're saying it will error out?

Re: check_nrpe

Posted: Fri Dec 11, 2015 2:20 pm
by nebblkshts
That is correct the "service" will not restart and point the that line in the config.

Re: check_nrpe

Posted: Fri Dec 11, 2015 2:22 pm
by hsmith
Can you run this in the directory that has your configs?

grep -r -e "command_name.*check_nrpe" .

Re: check_nrpe

Posted: Fri Dec 11, 2015 3:16 pm
by nebblkshts
The result is nothing just sits there.

Re: check_nrpe

Posted: Mon Dec 14, 2015 12:23 pm
by hsmith
How long did you let it run for? It is checking all of your files in the directory for that line.

Re: check_nrpe

Posted: Mon Dec 14, 2015 1:39 pm
by nebblkshts
I posted the response soon after you asked but I left the thing running all week-end.

Re: check_nrpe

Posted: Mon Dec 14, 2015 4:26 pm
by hsmith
You're not running grep -r -e "command_name.*check_nrpe" . on the root directory are you? You should only be running it in your nagios config directory.