On 28.04.2013 00:21, Jim Miller wrote:
>
> I’m going to feel REALLY bad when I figure out it’s something stupid 
> I’ve missed on my part. But I’m stumped. I can run check_nrpe from the 
> command line on the monitoring server w/out any problem. Two things I 
> haven’t tried are:
>
> 1.Replace $USER1$ with the actual path.
>
> 2.Run custom commands via NRPE
>
> For all of the nrpe_checks the server the logs show:
>
> *LOGS:*
>
> [1367058676] SERVICE NOTIFICATION: 
> icingaadmin;xio99cdejump02.example.com;Free Space of 
> sda1;CRITICAL;notify-service-by-email;Connection refused by host
>
> [1367059156] SERVICE NOTIFICATION: 
> icingaadmin;xio99cdejump02.example.com;Current 
> Users;CRITICAL;notify-service-by-email;Connection refused by host
>
> [1367059216] SERVICE NOTIFICATION: 
> icingaadmin;xio99cdejump02.example.com;Total 
> Processes;CRITICAL;notify-service-by-email;Connection refused by host
>
> [1367059276] SERVICE NOTIFICATION: 
> icingaadmin;xio99cdejump02.example.com;Zombie 
> Processes;CRITICAL;notify-service-by-email;Connection refused by host
>
> [1367059646] SERVICE NOTIFICATION: 
> icingaadmin;xio99cdejump02.example.com;CPU 
> Load;CRITICAL;notify-service-by-email;Connection refused by host
>
> *MANUAL CHECKS:***
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com
>
> NRPE v2.13
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_users_count -a 5 10
>
> USERS OK - 1 users currently logged in |users=1;5;10;0
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_load_avg -a 15,10,5 30,25,20
>
> OK - load average: 0.00, 0.00, 0.00|load1=0.000;15.000;30.000;0; 
> load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0;
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_sda1
>
> DISK OK - free space: /boot 379 MB (82% inode=99%);| 
> /boot=79MB;387;435;0;484
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_swap_usage
>
> SWAP OK - 100% free (5119 MB out of 5119 MB) |swap=5119MB;1023;511;0;5119
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_zombie_procs
>
> PROCS OK: 0 processes with STATE = Z
>
> [root@xio99cdejump01 icinga]# /usr/lib64/nagios/plugins/check_nrpe -H 
> xio99cdejump02.example.com -c check_total_procs
>
> PROCS OK: 106 processes
>

You're testing as root, which is not advised in terms of the core 
running as icinga user (a daemon, no shell, no .bashrc and such). More 
on that there: https://wiki.icinga.org/display/testing/Icinga+Plugin+Testing

> ==========================
>
> Monitored Client:
>
> RHEL 6.3
>
> NRPE - nrpe-2.13-1.el6.x86_64
>
> [root@xio99cdejump02 nagios]# netstat -anp |grep nrpe
>
> tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 5418/nrpe
>
> [root@xio99cdejump02 nagios]# ps auxw | grep nrpe
>
> nrpe 5570 0.0 0.0 40988 1212 ? Ss 10:04 0:04 /usr/sbin/nrpe -c 
> /etc/nagios/nrpe.cfg -d
>
> [root@xio99cdejump02 jimm]# cat /etc/passwd | grep nrp
>
> nrpe:x:498:499:NRPE user for the NRPE service:/var/run/nrpe:/sbin/nologin
>
> [root@xio99cdejump02 jimm]# cat /etc/group | grep nrp
>
> nrpe:x:499:
>
> [root@xio99cdejump02 nagios]# /etc/init.d/nrpe restart
>
> Shutting down nrpe: Apr 27 09:53:33 xio99cdejump02 nrpe[5418]: Caught 
> SIGTERM - shutting down...
>
> Apr 27 09:53:33 xio99cdejump02 nrpe[5418]: Daemon shutdown
>
> [ OK ]
>
> Starting nrpe: Apr 27 09:53:33 xio99cdejump02 nrpe[5502]: INFO: 
> SSL/TLS initialized. All network traffic will be encrypted.
>
> [ OK ]
>
> [root@xio99cdejump02 nagios]# Apr 27 09:53:33 xio99cdejump02 
> nrpe[5503]: Starting up daemon
>
> Apr 27 09:53:33 xio99cdejump02 nrpe[5503]: Warning: Daemon is 
> configured to accept command arguments from clients!
>
> Apr 27 09:53:33 xio99cdejump02 nrpe[5503]: Listening for connections 
> on port 5666
>
> Apr 27 09:53:33 xio99cdejump02 nrpe[5503]: Allowing connections from: 
> 127.0.0.1, 10.xxx.0.110
>

The 10.xxx.0.110 ip address is the one of your icinga host?
ipv6 is not enabled on both hosts?
>
> *Command Config Lines /etc/nagios/nrpe.cfg*
> command[check_users_count]=/usr/lib64/nagios/plugins/check_users -w 5 
> -c 10
>
> command[check_load_avg]=/usr/lib64/nagios/plugins/check_load -w 
> 15,10,5 -c 30,25,20
>
> command[check_sda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% 
> -p /dev/sda1
>
> command[check_swap_usage]=/usr/lib64/nagios/plugins/check_swap -w 20% 
> -c 10%
>
> command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 
> -c 10 -s Z
>
> command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 
> 150 -c 200
>
> Monitoring Server:
>
> Nagios Plugins – v.1.4.16-5
>
> Config files:
>
> -----------------------
>
> define command{
>
> command_name check_nrpe
>
> command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
>
> }
>
> -----------------------
>
> define host {
>
> use linux-server
>
> host_name xio99cdejump02.example.com
>
> alias "xio99cdejump02"
>
> address "10.xxx.0.110"
>
> }
>

There's a mismatch in tests here. Your tests were done with "-H 
xio99cdejump02.example.com" while the command definition uses the 
$HOSTADDRESS$ macro, which then leads to the host attribute address with 
the value "10.xxx.0.110". So maybe it does not work at all as the manual 
tests resolve the fqdn to a different ip address in your dns?

In order to fully expand the command the core would execute, go onto 
Classic UI - Service Details (extinfo.cgi) and click on "ACTIVE" where 
the link to the command expander is hiding. Right on, you should see all 
macros properly replaced (make sure 
authorized_for_full_command_resultion is set for your login name as well 
as access to resource.cfg is granted to the apache user). That way, you 
can become icinga user and copy paste the entire command then, avoiding 
manual thinkos.

In terms of the error - tcpdump on 5666 on the client host, in order to 
see if handshakes actually happen.

Kind regards,
Michael


> define service {
>
> use generic-service
>
> host_name xio99cdejump02.example.com
>
> service_description CPU Load
>
> check_command check_nrpe!check_load_avg
>
> }
>
> define service {
>
> use generic-service
>
> host_name xio99cdejump02.example.com
>
> service_description Current Users
>
> check_command check_nrpe!check_users_count
>
> }
>
> define service {
>
> use generic-service
>
> host_name xio99cdejump02.example.com
>
> service_description Check Swap
>
> check_command check_nrpe!check_swap_usage
>
> }
>
> define service {
>
> use generic-service
>
> host_name xio99cdejump02.example.com
>
> service_description Free Space of sda1
>
> check_command check_nrpe!check_sda1
>
> }
>
> ---------------------------
>
> Thanks for any suggestions,
>
> Jim
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now&  We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app,&  servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>
>
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/icinga-users


-- 
DI (FH) Michael Friedrich

mail:     michael.friedr...@gmail.com
twitter:  https://twitter.com/dnsmichi
jabber:   dnsmi...@jabber.ccc.de
irc:      irc.freenode.net/icinga dnsmichi

icinga open source monitoring
position: lead core developer
url:      https://www.icinga.org


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to