Page 1 of 2

(No output on stdout) stderr: on second check

Posted: Thu Aug 20, 2015 2:14 pm
by almonitoradmin
I've included my system details at the bottom of this email...

I installed a new plugin: https://exchange.nagios.org/directory/P ... 29/details

I can run the command on the command line:

[root@usawexx011 ~]# /usr/local/nagios/libexec/check_apachestatus_auto.pl -H 10.x.x.x -w 40 -c 20 -U statususer -P mypass
APACHE OK - 0.405 sec. response time, Busy/Idle 8/15, open 233/256, ReqPerSec 0.1, BytesPerReq 0, BytesPerSec 0|Idle=15 Busy=8 OpenSlots=233 Slots=256 Starting=0 Reading=7 Sending=1 Keepalive=0 DNS=0 Closing=0 Logging=0 Finishing=0 ReqPerSec=0.055556 BytesPerReq=0 BytesPerSec=0.000000 Accesses=1[root@usawexx011 ~]#

[root@usawexx011 ~]# ls -al /usr/local/nagios/libexec/check_apachestatus_auto.pl
-rwxrwxr-x 1 nagios nagios 11096 Aug 12 21:11 /usr/local/nagios/libexec/check_apachestatus_auto.pl


OK...
So, I went to add my first test in, and configured it, ran "test check command", and got this:

Code: Select all

Testing check from command line...

COMMAND: /usr/local/nagios/libexec/check_apachestatus_auto.pl -H 10.x.x.x -w 40 -c 20 -U statususer -P mypass
OUTPUT:
Hmm...strange. OK, so, I went ahead and finished adding it anyway, and the test worked - it's green and i get result summary.

Cool.

Now...onto the next server I want to check. Performed the same steps, got the same test result, but this time, for this host, in the services window, the status is red, and says:

Code: Select all

(No output on stdout) stderr:


I don't know where to go from here. Can anyone offer some help?







CentOS 6.5 x86_64
Manual Install

Nagios XI Installation Profile
Download Profile
System:
Nagios XI Version : 2014R1.0
usawepvl011.xxx.xxx.com 2.6.32-431.11.2.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Apache Information
PHP Version: 5.3.3
Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1
Server Name: nagios.xxx.com
Server Address: 10.x.x.x
Server Port: 443
Date/Time
PHP Timezone: America/Chicago
PHP Time: Thu, 20 Aug 2015 13:51:32 -0500
System Time: Thu, 20 Aug 2015 13:51:32 -0500
Nagios XI Data
License ends in: MTSVNN

nagios (pid 22992) is running...
NPCD running (pid 1379).
ndo2db (pid 1442) is running...
CPU Load 15: 7.45
Total Hosts: 112
Total Services: 1632
Function 'get_base_uri' returns: https://nagios.xxx.com/nagiosxi/
Function 'get_base_url' returns: https://nagios.xxx.com/nagiosxi/
Function 'get_backend_url(internal_call=false)' returns: https://nagios.xxx.com/nagiosxi/include ... rofile.php
Function 'get_backend_url(internal_call=true)' returns: http://localhost/nagiosxi/backend/
Ping Test localhost
Running:

/bin/ping -c 3 localhost 2>&1

PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.028 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.031 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.024 ms

--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 0.024/0.027/0.031/0.006 ms
Test wget To locahost
WGET From URL: http://localhost/nagiosql/index.php
Running:

/usr/bin/wget http://localhost/nagiosql/index.php

--2015-08-20 13:51:35-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5259 (5.1K) [text/html]
Saving to: "/usr/local/nagiosxi/tmp/nagiosql_index.tmp"

0K ..... 100% 299M=0s

2015-08-20 13:51:35 (299 MB/s) - "/usr/local/nagiosxi/tmp/nagiosql_index.tmp" saved [5259/5259]

Re: (No output on stdout) stderr: on second check

Posted: Thu Aug 20, 2015 4:59 pm
by tmcdonald
Are the script's permissions the same on both servers? What happens when you test run it from the CLI as the nagios user as opposed to root?

Re: (No output on stdout) stderr: on second check

Posted: Thu Aug 20, 2015 9:01 pm
by almonitoradmin
I probably did not make it clear...this is all on 1 nagios server. I have 2 apache hosts I want to perform the check against. When I assigned the service to the first host, it worked (although I don't get the output of the script in the Test Command window. The second apache host I check against, does the same thing but the check simply give the No output on stdout error.

If I run the command from the command line as the nagios user, it also passes and returns output.

Re: (No output on stdout) stderr: on second check

Posted: Fri Aug 21, 2015 2:14 am
by Box293
First off I can see you are running into a problem which can be misleading, it has to do with using the "Test Check Command" button.

Due to some issues with how PHP escapes characters the "Test Check Command" does not work in these situations and should be ignored.

So for all further testing of this service you need to:

Make the changes to the service
Save the Service
Apply Confguration
Go back to the home screen and find the Service
When viewing the Service Status Details page click the Schedule a forced immediate check link

Just to re-iterate, for all further testing for this service DO NOT use the "Test Check Command" button, follow the steps above.

Next
almonitoradmin wrote:If I run the command from the command line as the nagios user, it also passes and returns output.
Can I confirm you are testing as nagios?

Code: Select all

su nagios
/usr/local/nagios/libexec/check_apachestatus_auto.pl -H 10.x.x.x -w 40 -c 20 -U statususer -P mypass
Can you please post the command and service definitions from CCM. Click the disk icon in the far right column to get the definitions.

Finally, I see your password is mypass. I'm sure that's not your real password, does your real password have any special characters like ! or $ ?

Re: (No output on stdout) stderr: on second check

Posted: Mon Aug 24, 2015 12:55 pm
by almonitoradmin
No, I am not using any special characters in my password.

Here is the output of my service command dump:

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2015-08-24 11:42:35
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        host_name                       pgqawww02.foo.com
        service_description             / Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /home Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /home'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /tmp Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /tmp'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /usr Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /usr'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /var Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /var'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /var/log Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /var/log'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Apache Thread Count
        check_command                   check_apachestatus_auto!!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Apache Web Server
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'httpd'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             CPU Stats
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_cpu_stats!-a '-w 85 -c 95'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Cron Scheduling Daemon
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'crond'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Load
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Memory Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_mem!-a '-w 20 -c 10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Open Files
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_open_files!-a '-w 30 -c 50'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Ping
        use                             xiwizard_linuxserver_ping_service
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Puppet Error Log
        check_command                   check_nrpe!check_log_puppet!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport
        contact_groups                  csupport
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             RPC Daemon
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'rpcbind'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             SSH Server
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'sshd'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Swap Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_swap!-a '-w 50 -c 20'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             TCP Port 443
        check_command                   check_xi_service_tcp!-p '443' -w '5' -c '10'!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Users
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_users!-a '-w 5 -c 10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################



and here is my check command:

Code: Select all

$USER1$/check_apachestatus_auto.pl -H $HOSTADDRESS$ -w 40 -c 20 -U statususer -P passwd

Re: (No output on stdout) stderr: on second check

Posted: Mon Aug 24, 2015 1:14 pm
by hsmith
almonitoradmin wrote:No, I am not using any special characters in my password.

Here is the output of my service command dump:

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2015-08-24 11:42:35
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        host_name                       pgqawww02.foo.com
        service_description             / Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /home Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /home'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /tmp Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /tmp'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /usr Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /usr'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /var Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /var'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             /var/log Disk Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /var/log'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Apache Thread Count
        check_command                   check_apachestatus_auto!!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Apache Web Server
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'httpd'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             CPU Stats
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_cpu_stats!-a '-w 85 -c 95'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Cron Scheduling Daemon
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'crond'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Load
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Memory Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_mem!-a '-w 20 -c 10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Open Files
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_open_files!-a '-w 30 -c 50'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Ping
        use                             xiwizard_linuxserver_ping_service
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Puppet Error Log
        check_command                   check_nrpe!check_log_puppet!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport
        contact_groups                  csupport
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             RPC Daemon
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'rpcbind'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             SSH Server
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_init_service!-a 'sshd'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Swap Usage
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_swap!-a '-w 50 -c 20'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        ecentralsupport,foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             TCP Port 443
        check_command                   check_xi_service_tcp!-p '443' -w '5' -c '10'!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

define service {
        host_name                       pgqawww02.foo.com
        service_description             Users
        use                             xiwizard_nrpe_service
        check_command                   check_nrpe!check_users!-a '-w 5 -c 10'!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        contact_groups                  csupport
        _xiwizard                       linux-server
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################



and here is my check command:

Code: Select all

$USER1$/check_apachestatus_auto.pl -H $HOSTADDRESS$ -w 40 -c 20 -U statususer -P passwd
Is the service file you posted the one for the working or non-working site? Can you include the other one for comparison? Just the section of it relating to this plugin.

Re: (No output on stdout) stderr: on second check

Posted: Mon Aug 24, 2015 2:20 pm
by almonitoradmin
The one I posted is for the non-working one. Here is the config for the working one:

Code: Select all


define service {
	host_name			pgqawww01.foo.com
	service_description		Apache Thread Count
	check_command			check_apachestatus_auto!!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			foo942
	register			1
	}	

Re: (No output on stdout) stderr: on second check

Posted: Mon Aug 24, 2015 8:55 pm
by Box293
almonitoradmin wrote:the non-working one

Code: Select all

define service {
        host_name                       pgqawww02.foo.com
        service_description             Apache Thread Count
        check_command                   check_apachestatus_auto!!!!!!!!
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        foo942
        register                        1
        }
almonitoradmin wrote:the working one:

Code: Select all

define service {
	host_name			pgqawww01.foo.com
	service_description		Apache Thread Count
	check_command			check_apachestatus_auto!!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			foo942
	register			1
	}
The only thing I can spot that is different is the host object is assigned to. I want to go back to basics here, for the host pgqawww02.foo.com, can you go to the host object and make sure the address defined in the object is the same as the address you use to test with at the command line.

Re: (No output on stdout) stderr: on second check

Posted: Tue Aug 25, 2015 10:23 am
by almonitoradmin
I just double checked the host definition and I was able to confirm that the host matches the host I used on the command line.

Re: (No output on stdout) stderr: on second check

Posted: Tue Aug 25, 2015 10:52 am
by hsmith
Hmm.. are the both of the servers running the same OS and version of Apache? Everything seems super normal on the Nagios side of things, which makes me wonder if the server is sending back something that the plugin is having trouble with..