Page 2 of 3
Re: Check DB instance
Posted: Wed Jun 28, 2017 4:59 pm
by tmcdonald
The reason you were not notified is because you copied the localhost checks, which run on the Nagios server itself. You need to run remote checks through something like NRPE:
https://assets.nagios.com/downloads/nag ... g_NRPE.pdf
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:39 pm
by donnyforbes
I just saw that.. I will look into this. Thanks
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:43 pm
by donnyforbes
The reason you were not notified is because you copied the localhost checks, which run on the Nagios server itself. You need to run remote checks through something like NRPE:
https://assets.nagios.com/downloads/nag ... g_NRPE.pdf
I believe I already have nrpe installed on the remote host. Did that durning the install the linux agent ./fullinstall
Do I edit the service for the hosts and then click on Managed Templetes? Which templete would I select. I know it had localhost .
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:48 pm
by donnyforbes
See this screenshot. I believe I have the NRPE installed if not i will install it. See below and let me know
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:51 pm
by donnyforbes
I already installed this see below ..
Code: Select all
[root@duey linux-nrpe-agent]# pwd
/tmp/linux-nrpe-agent
[root@duey linux-nrpe-agent]# ls
0-repos 3-services CHANGES.txt init.sh installed.repos installed.usersgroups packages xi-sys.cfg
1-prereqs 4-firewall fullinstall installed.firewall installed.services install.log subcomponents xivar
2-usersgroups A-subcomponents get-os-info installed.prereqs installed.subcomponents nagios.firewallapps xinrpe
[root@duey linux-nrpe-agent]#
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:55 pm
by donnyforbes
The reason you were not notified is because you copied the localhost checks, which run on the Nagios server itself. You need to run remote checks through something like NRPE:
https://assets.nagios.com/downloads/nag ... g_NRPE.pdf
Since this is already installed I believe I need to change the service for duey "Service Status - httpd" manage templete to something else.
Should I change it to this to "xiwizard_nrpe_service" If not what do I change it to? Please advise.
Re: Check DB instance
Posted: Wed Jun 28, 2017 5:57 pm
by donnyforbes
That did not work. When I run the "Run Check Command" the output is the nagios server not the remote see below. I need it on the duey server which is a remote hosts
Code: Select all
nagios@nag ~]$ sudo /usr/local/nagiosxi/scripts/manage_services.sh status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-06-28 08:11:14 PDT; 7h ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 63314 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 46782 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
Main PID: 63327 (httpd)
Status: "Total requests: 6646; Current requests/sec: 0.2; Current traffic: 307 B/sec"
CGroup: /system.slice/httpd.service
├─ 2824 /usr/sbin/httpd -DFOREGROUND
├─ 2826 /usr/sbin/httpd -DFOREGROUND
├─12879 /usr/sbin/httpd -DFOREGROUND
├─15365 /usr/sbin/httpd -DFOREGROUND
├─17856 /usr/sbin/httpd -DFOREGROUND
├─22316 /usr/sbin/httpd -DFOREGROUND
├─23348 /usr/sbin/httpd -DFOREGROUND
├─61134 /usr/sbin/httpd -DFOREGROUND
├─61135 /usr/sbin/httpd -DFOREGROUND
├─63327 /usr/sbin/httpd -DFOREGROUND
└─63334 /usr/sbin/httpd -DFOREGROUND
Jun 28 08:11:13 nag systemd[1]: Starting The Apache HTTP Server...
Jun 28 08:11:14 nag systemd[1]: Started The Apache HTTP Server.
Re: Check DB instance
Posted: Wed Jun 28, 2017 6:08 pm
by donnyforbes
Here is what I did... I change the check command to ->
check_nrpe
$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
$ARG1$ httpd
Then ran the "Run check command" put the ip_address in of the remote server see below.
Run Check Command
Host Address: 192.168.1.43
Run Check Command
[nagios@nag ~]$ /usr/local/nagios/libexec/check_nrpe -H 192.168.1.43 -t 30 -c httpd
NRPE: Command 'httpd' not defined
Is this how I get this to work?
Re: Check DB instance
Posted: Wed Jun 28, 2017 6:11 pm
by donnyforbes
Got it to work see below
***** Nagios XI Alert *****
Nagios has detected a problem with this service.
Notification Type: PROBLEM
Service: Service Status - httpd - Infx_OAT
Host: duey.sg1.allamericanasphalt.com
Address: 192.168.1.43
State: CRITICAL
Info:
NRPE: Command httpd not defined
Date/Time: 2017-06-28 16:10:24
Re: Check DB instance
Posted: Wed Jun 28, 2017 6:29 pm
by donnyforbes
go ahead and locked this ticket.