Page 1 of 3
NRDP
Posted: Tue Jun 07, 2016 7:31 am
by peter19x
Hello,
I was able to install NRDP and make sure it is working fine.
I have sent some passive checks from my server to the nagios core but I do not know how I can see them in nagios core. I know that in Nagios XI I need to go to Unconfigured objects and accept them. How is it done in nagios core?
Thanks,
Peter
Re: NRDP
Posted: Tue Jun 07, 2016 10:16 am
by tmcdonald
The Unconfigured Objects page in XI basically shows output from parsing the logs, specifically looking for any mentions of results found for a host/service that does not exist (is not in the CCM). It then lists the names there and gives you the option to configure them. In Core, you need to configure these by hand to match the exact names that are being sent in.
Re: NRDP
Posted: Wed Jun 08, 2016 7:44 am
by peter19x
Hello,
Thank you for the response. Is there a guide on how to do that ?
Best Regards,
Peter
Re: NRDP
Posted: Wed Jun 08, 2016 3:02 pm
by tmcdonald
Not for Core, no. That's an XI thing only, unfortunately.
Re: NRDP
Posted: Wed Jun 08, 2016 3:22 pm
by eloyd
@donald may be overthinking this.
Since there is no "unconfigured objects" in Nagios Core, there is no guide on how to do it. But there are plenty of guides to installing hosts in Nagios Core, not the least of which is
https://assets.nagios.com/downloads/nag ... bject.html.
What you need to do is search your /usr/local/nagios/var/nagios.log file for service check results for hosts/services that do not exist. Once you have that information, you can go build new config files (or add them to existing templates) to configure them.
As Nagios Core is always configured by changing configuration files on the filesystem, this is why a lot of people pay for XI - it makes [re-]configuration much easier. However, Nagios Core, because it only relies on configuration files, can be much more easily scripted and automated, so once you figure out how to do this once, you can write a cron job that will scan for unconfigured objects in your nagios.log file every 30 minutes (or whatever you want) and automatically add things it finds.
Re: NRDP
Posted: Wed Jun 08, 2016 4:00 pm
by tmcdonald
Thanks for the added details, @eliod!
Re: NRDP
Posted: Thu Jun 09, 2016 8:15 am
by eloyd
No problem, @TMCdonald.
Re: NRDP
Posted: Thu Jun 09, 2016 12:04 pm
by tmcdonald
@peter19x did you have any related questions or are we good to close this up?
Re: NRDP
Posted: Mon Jun 13, 2016 5:12 am
by peter19x
Hello,
Sorry for the late reply.
I have done as you advised @Eloyd and my passive checks were not showed in the log file below:
Code: Select all
[root@GSIP_MGNT_A admin]# cat /usr/local/nagios/var/nagios.log
[1465772400] LOG ROTATION: DAILY
[1465772400] LOG VERSION: 2.0
[1465772400] CURRENT HOST STATE: localhost;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.03 ms
[1465772400] CURRENT SERVICE STATE: localhost;Current Load;OK;HARD;1;OK - load average: 0.00, 0.01, 0.05
[1465772400] CURRENT SERVICE STATE: localhost;Current Users;OK;HARD;1;USERS OK - 1 users currently logged in
[1465772400] CURRENT SERVICE STATE: localhost;HTTP;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 403 Forbidden - 3737 bytes in 0.001 second response time
[1465772400] CURRENT SERVICE STATE: localhost;PING;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 0.03 ms
[1465772400] CURRENT SERVICE STATE: localhost;Root Partition;OK;HARD;1;DISK OK - free space: / 2782 MB (75% inode=93%):
[1465772400] CURRENT SERVICE STATE: localhost;SSH;OK;HARD;1;SSH OK - OpenSSH_5.3 (protocol 2.0)
[1465772400] CURRENT SERVICE STATE: localhost;Swap Usage;OK;HARD;1;SWAP OK - 100% free (8191 MB out of 8191 MB)
[1465772400] CURRENT SERVICE STATE: localhost;Total Processes;OK;HARD;1;PROCS OK: 193 processes with STATE = RSZDT
[1465774181] Auto-save of retention data completed successfully.
[1465777781] Auto-save of retention data completed successfully.
[1465781381] Auto-save of retention data completed successfully.
[1465784981] Auto-save of retention data completed successfully.
Is this the way it should be done?
Thanks,
Peter
Re: NRDP
Posted: Mon Jun 13, 2016 9:45 am
by eloyd
I am not sure what you did, specifically, since what I suggested was an idea, not a series of steps. I'll run through some steps here.
First, I used NRDP to send a passive check back to my Nagios server for a bogus host, and a bogus service on on that host. This is what shows up in the nagios.log:
Code: Select all
[1465828938] Error: Got host checkresult for 'NOTAREALHOST', but no such host can be found
[1465829018] Error: Got check result for service 'NOTAREALSERVICE' on host 'NOTAREALHOST'. Unable to find service
Now I can use grep on the nagios.log file to find "but no such host can be found" to look for hosts which show up as passive checks but aren't configured. I can also search for "Unable to find service" to look for services that are sending checks but aren't configured.
With that information, I could create a script which does this automatically, adds NOTAREALHOST to a basic template of simple hosts, and NOTAREALSERVICE to a basic template for simple service checks. Obviously, a disk check would have different requirements and alerting than a CPU or memory check, so you will need to program in some decisions based on the name of the service check.