I have done the following
[root@huey libexec]# cat check_ifx.sh
#!/bin/bash
#
# Check_ifx - plugin to validate that informix is online
#
Now when I run the script i am seeing this...
Code: Select all
[root@huey libexec]# ./check_ifx.sh
./check_ifx.sh: line 15: STATE_OK: command not found
./check_ifx.sh: line 16: STATE_WARNING: command not found
./check_ifx.sh: line 17: STATE_CRITICAL: command not found
./check_ifx.sh: line 18: STATE_UNKNOWN: command not found
./check_ifx.sh: line 20: If: command not found
./check_ifx.sh: line 21: Then: command not found
./check_ifx.sh: line 10: Echo: command not found
./check_ifx.sh: line 11: Echo: command not found
./check_ifx.sh: line 12: Echo: command not found
./check_ifx.sh: line 23: Exit: command not found
./check_ifx.sh: line 24: Fi: command not found
./check_ifx.sh: line 26: If: command not found
./check_ifx.sh: line 27: Then: command not found
./check_ifx.sh: line 10: Echo: command not found
./check_ifx.sh: line 11: Echo: command not found
./check_ifx.sh: line 12: Echo: command not found
./check_ifx.sh: line 29: Exit: command not found
./check_ifx.sh: line 30: Fi: command not found
./check_ifx.sh: line 32: Export: command not found
./check_ifx.sh: line 33: Export: command not found
./check_ifx.sh: line 35: $: command not found
./check_ifx.sh: line 35: Result: command not found
./check_ifx.sh: line 37: For: command not found
./check_ifx.sh: line 38: syntax error near unexpected token `do'
./check_ifx.sh: line 38: `do'
[root@huey libexec]#
It could be because informix is running right now, however I see this still in the XI.
Is there a way to test this to make sure everything is working correct form the XI? Also, do I need to do service nrpe restart && service xinetd restart ??? One thing I notice is this.
When I do both then do a grep for the following
Code: Select all
[root@huey libexec]# ps -ef |grep nrpe
root 55709 20529 0 15:48 pts/0 00:00:00 grep --color=auto nrpe
[root@huey libexec]# ps -ef |grep 5666
root 56164 20529 0 15:49 pts/0 00:00:00 grep --color=auto 5666
[root@huey libexec]# ps -ef |grep xinetd
root 53374 1 0 15:46 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root 56205 20529 0 15:49 pts/0 00:00:00 grep --color=auto xinetd
When running the command from the XI I am getting the following message.
[nagios@nag ~]$ /usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -t 30 -c
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (
[email protected])
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required
Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]
Options:
-n = Do no use SSL
-u = Make socket timeouts return an UNKNOWN state instead of CRITICAL
<host> = The address of the host running the NRPE daemon
<bindaddr> = bind to local address
-4 = user ipv4 only
-6 = user ipv6 only
[port] = The port on which the daemon is running (default=5666)
[timeout] = Number of seconds before connection times out (default=10)
[command] = The name of the command that the remote daemon should run
[arglist] = Optional arguments that should be passed to the command. Multiple
arguments should be separated by a space. If provided, this must be
the last option supplied on the command line.
Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.
Am I missing something here? Also one last thing when I run the following command..
Code: Select all
[root@nag etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.42 -c check_ifx.sh
NRPE: Command 'check_ifx.sh' not defined
[root@nag etc]#
Here is the /usr/local/nagios/etc/nrpe.cfg
#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
#command[check_informix]=/usr/local/nagios/libexec/check_informix.sh
command[check_http]=/usr/local/nagios/libexec/check_http
command[check_ifx]=/usr/lccal/nagios/libexec/check_ifx.sh