how ncpa agent works

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

how ncpa agent works

Post by kendallchenoweth »

Can someone tell me if the NCPA agent has any sort of queueing support so that if the agent becomes disconnected from the server and an event happens during that time, the event is queued up and sent when the agent is reconnected to the server? I'm thinking of a scenario described below...

time 1
server monitors agent successfully, everything OK

time 2
server cannot monitor agent (doesn't matter why), everything OK

time 3
something goes wrong on agent, it would be detected by a service check

time 4
problem above resolves itself

time 5
server can again successfully monitor agent, current polling/scanning shows everything OK

Does the event in time 3 get queued up and sent out to the server ever?

Thanks!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: how ncpa agent works

Post by slansing »

Not specifically, are you speaking in active checking terms or passive? Active checks are initiated from nagios so they would only trigger a plugin check run on the remote client when a connection is active. Passively, checks are not queued but they work on a cron basis being checked every 5 minutes by default.
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: how ncpa agent works

Post by kendallchenoweth »

Are passive checks initiated by the ncpa client locally? If so, do all checks have the same polling interval? I assume that if you have passive checks, you can't have active checks and the passive checks obviously depend on cron running. Would it be possible to configure the nagios server to active check the status of the crond daemon, check the port status of the ncpa daemon on the client actively and then passively monitor the remaining checks? If so, I assume that all service configuration can still be managed from the server.

Thanks very much for your help!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: how ncpa agent works

Post by tmcdonald »

kendallchenoweth wrote:Are passive checks initiated by the ncpa client locally?
Yes, all passive checks are initiated by the host they are on. However, NCPA also allows for active checks initiated by the Nagios server.
kendallchenoweth wrote:If so, do all checks have the same polling interval?
Yes and no. If you have two different services sending passive checks, they can be configured for different intervals. However NCPA itself only allows one interval to be configured.
kendallchenoweth wrote:I assume that if you have passive checks, you can't have active checks
Incorrect. You can actively check a host that is sending passive checks, and in fact this is sometimes what you want to do in case the passive checks have not been sent in a while. This is called Freshness Checking:

http://nagios.sourceforge.net/docs/3_0/freshness.html

Basically if a passive host has not sent a check result in a while (it might be down or network issue is occurring) then Nagios can actively check that host to make sure it is okay,
kendallchenoweth wrote:and the passive checks obviously depend on cron running.
Usually this is a good way to do it, however on Windows there is no cron so if you have NCPA running there it will use some other method. Some passive agents use their own custom method.
kendallchenoweth wrote:Would it be possible to configure the nagios server to active check the status of the crond daemon, check the port status of the ncpa daemon on the client actively and then passively monitor the remaining checks? If so, I assume that all service configuration can still be managed from the server.
I *think* you might be talking about freshness checking here, but I'm not sure. Can you give an example?
Former Nagios employee
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: how ncpa agent works

Post by kendallchenoweth »

For the NCPA passive agent monitoring (that's initiated and polled from the client independent of the nagios server), do I need to manually configure the checks in cron or is this part of the ncpa passive agent configuration? If the later, can you point me to a documentation link on how to do that? For new service checks, can they be configured on the nagios server and added to the ncpa passive polling automatically or is there some additional effort required on the client?

I see a good solution of using a ncpa passive agent polling and sending data (passive checks) to the nagios server and using a combination of an active check on the crond and ncpa port status as well as freshness on additional passive checks to ensure that everything is working while minimizing client server network traffic.

Based on this I think that by using passive checks, I would catch the error below from time 3, assuming the ncpa agent has the ability to queue events.

time 1
server monitors agent successfully, everything OK

time 2
server cannot monitor agent (doesn't matter why), everything OK

time 3
something goes wrong on agent, it would be detected by a service check

time 4
problem above resolves itself

time 5
server can again successfully monitor agent, current polling/scanning shows everything OK

Please correct me if I've said something wrong or you can suggest something better. Thanks for your help.

-Kendall Chenoweth
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: how ncpa agent works

Post by sreinhardt »

Passive checks handled via NCPA are entirely separate from cron or windows scheduled tasks, it handles the scheduling internally and will run them every time the sleep\wait time has passed in its configuration. Once the passive checks are configured in NCPA it will handle the rest in regards to scheduling and sending results to nagios. You will need to configure a passive service on the nagios side, and setup the check on ncpa to be run properly. You do have the option to work with NRDS config management, however that is a whole other talk. :D

I would agree that ncpa is a pretty great solution, however you don't need to monitor cron as mentioned above.

This may not have been covered via tmcdonald's post, but ncpa does not have a queue of past processed passive checks. If the check does not send when it is scheduled, my understanding is that it will not be sent again, ever. You might be able to write some form of spool, that ncpa outputs passive checks too, then has an additional check\cron that reaps this and only removes them if they are sent properly. However, this is precisely what freshness checks are for, when a passive check does not come back in a timely manor, freshness checks are used to verify the status of the host\service in place of that passive result.

Otherwise I think you've got a pretty solid understanding and idea of how to move forward with this!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: how ncpa agent works

Post by kendallchenoweth »

Thanks! I'm all set.
Locked