Passive check configuration with ncpa and nsca

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Passive check configuration with ncpa and nsca

Post by grayloglearn »

Hi Team,

Can some one tell that how to configure the passive check via nsclient and ncpa.

i have installed the ncpa 2.2.0 in windows. I have given the following details while i am installing

[nrdp]

#
# Connection settings to the NRDP server
# parent = NRDP server location (ex: http://<address>/nrdp)
# token = NRDP server token used to send NRDP results
#
parent =https://172.31.40.170/nrdp (172.31.40.170 this is nagios server IP)
token =Test@123
hostname =172.31.40.170 (windows server IP)

The below is the nrdp.cfg
# AUTO GENERATED NRDP CONFIG FROM WINDOWS INSTALLER
#

[passive checks]

# Host check - This is to stop "pending check" status in Nagios
%HOSTNAME%|__HOST__ = system/agent_version

# Service checks
%HOSTNAME%|CPU Usage = cpu/percent --warning 80 --critical 90 --aggregate avg
%HOSTNAME%|Disk Usage = disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400

Now I am not able to see any service details in nagiosxi unconfigured object :-( Let me know if you need any details.

And please suggest how to do passive checks with nsclient also.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Passive check configuration with ncpa and nsca

Post by Box293 »

We have two separate documents for exactly this, have you read them at all?

https://assets.nagios.com/downloads/ncp ... Checks.pdf
https://assets.nagios.com/downloads/nag ... Checks.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: Passive check configuration with ncpa and nsca

Post by grayloglearn »

thanks for the replay i am trying to enable monitor first ncpa.
The first URL helped to on this. I have given nagiosIP instead of hostname. I don't know why its not worked.

Can you tell me how to how to send the custom script output to nagios.
We have one script that output should send the data to nagios.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Passive check configuration with ncpa and nsca

Post by Box293 »

This KB article should help answer that:

https://support.nagios.com/kb/article/n ... a-722.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: Passive check configuration with ncpa and nsca

Post by grayloglearn »

thanks for the document.
Can you please clear on this below quires.

Passive checks means client it self it should send the data to nagios right?
We have observed in nagios console it not updated with latest passive checks.
Ex: We have turn on the nagiosxi server and agent which configured passive checks.
the agent is being up from 20 min but still nagios did not receive any services check status from agent. What is the reason for this. the agent is working fine in this server.

If you want to change the passive checks should come every 2 min in the client side where we have change could you please help on this please.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Passive check configuration with ncpa and nsca

Post by mbellerue »

Correct, passive checks are checks that are scheduled on the remote host, executed, and then only the results of the service check are sent to Nagios.

Is the remote host a Windows or Linux host? Can you show me the configuration file where your passive check is defined?

You can change the passive check execution frequency in the ncpa.cfg file. The setting sleep is what you are looking for. By default it is set to 300 seconds. But, whenever the ncpa_passive service starts up, it does execute the passive checks right away, unless it was told not to. So if you have waited 20 minutes, and received no passive checks, we'll need to check the configuration.

The very first thing I would look at is the token setting in the nrdp section. Double check that it is a valid token on your XI server under Admin -> Inbound Transfers. Also validate that the remote host can access the Nagios server by FQDN if FQDN is what you are using. Also, if it's a Linux system, make sure the permissions on the config file containing the passive check are correct.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: Passive check configuration with ncpa and nsca

Post by grayloglearn »

thanks for the reply.

I have configured both passive and active check for the custom script.
We are able to get the but in nagios console limited rows its showing.

Configured with active checks:
1) installed the ncpa and communication is working fine.
2) copied the script in plugins (Script is executing and giving output as we expected in windows server 2016

the below is the output where is its showing multiple in rows in command prompt it not showing in nagios console.
I am attaching the script which is working fine. Please help on this.

[nagios@ip-172-31-84-117 ~]$ /usr/local/nagios/libexec/check_ncpa.py -H ip-172-31-94-235.ec2.internal -t 'Test@123' -P 5693 -M 'plugins/dhcpncpa.ps1'
OK: scope1 in good order. scope1 is 0% used, (0 leases, 7 IP's available.) | freeIPS=7; AvailableIPS=0;
OK: scope2 in good order. scope2 is 0% used, (0 leases, 5 IP's available.) | freeIPS=5; AvailableIPS=0;
OK: scop3 in good order. scop3 is 0% used, (0 leases, 8 IP's available.) | freeIPS=8; AvailableIPS=0;
OK: scop4 in good order. scop4 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scop6 in good order. scop6 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scope5 in good order. scope5 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scop7 in good order. scop7 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scop8 in good order. scop8 is 0% used, (0 leases, 5 IP's available.) | freeIPS=5; AvailableIPS=0;
OK: scop10 in good order. scop10 is 0% used, (0 leases, 7 IP's available.) | freeIPS=7; AvailableIPS=0;
OK: scope11 in good order. scope11 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scop13 in good order. scop13 is 0% used, (0 leases, 3 IP's available.) | freeIPS=3; AvailableIPS=0;
OK: scop13 in good order. scop13 is 0% used, (0 leases, 6 IP's available.) | freeIPS=6; AvailableIPS=0;
OK: scop15 in good order. scop15 is 0% used, (0 leases, 4 IP's available.) | freeIPS=4; AvailableIPS=0;
OK: scop17 in good order. scop17 is 0% used, (0 leases, 2 IP's available.) | freeIPS=2; AvailableIPS=0;
OK: scop18 in good order. scop18 is 0% used, (0 leases, 2 IP's available.) | freeIPS=2; AvailableIPS=0;
OK: scope19 in good order. scope19 is 0% used, (0 leases, 3 IP's available.) | freeIPS=3; AvailableIPS=0;
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Passive check configuration with ncpa and nsca

Post by Box293 »

Can you please provide a screenshot of the Advanced tab of that service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
grayloglearn
Posts: 222
Joined: Thu Jul 06, 2017 8:55 am

Re: Passive check configuration with ncpa and nsca

Post by grayloglearn »

Hi Team,

Thanks for the replay,

Please find the attachments for the active checks.
When we see last 4 hours data its showing in performance graphs but graph is not coming but graph icon is came on service name.But its not showing entire output in nagios console.

And i have configured the passive checks using same scripts. I could'not see difference in showing output. Please find the attachment for this too.
the same i have see in passive checks When we see last 4 hours data its showing in performance graphs but graph is not coming but graph icon is came on service name.But its not showing entire output in nagios console. But i could see there is mark in graph. i have marked with yellow colored in attachment. you can find the attachment for this tool. I have attached all passive check configuration in passive.7z file please check that also.
You do not have the required permissions to view the files attached to this post.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Passive check configuration with ncpa and nsca

Post by Box293 »

In your screenshot is a lot of data sources being returned and I see the issue. The first issue is that you have a lot of performance data coming in that all has the same label:

Code: Select all

OK: scope1 in good order. scope1 is 0% used, (0 leases, 7 IP's available.) | freeIPS=7; AvailableIPS=0;
OK: scope2 in good order. scope2 is 0% used, (0 leases, 5 IP's available.) | freeIPS=5; AvailableIPS=0;
freeIPS=7; AvailableIPS=0;
freeIPS=5; AvailableIPS=0;

Both of these are called freeIPS and AvailableIPS and hence the data would be overwriting the existing ones each time.

Each datasource needs to be unique, for example the scope name needs to be appended to the labels, example:

Code: Select all

OK: scope1 in good order. scope1 is 0% used, (0 leases, 7 IP's available.) | scope1_freeIPS=7; scope1_AvailableIPS=0;
OK: scope2 in good order. scope2 is 0% used, (0 leases, 5 IP's available.) | scope2_freeIPS=5; scope2_AvailableIPS=0;
Once you've updated your plugin so it is returning the unique data source names then you will also need to delete the existing RRD and XML files for this service as they will cause issues with the new data coming in. Deleting them starts it from scratch. The files should be in /usr/local/nagios/share/perfdata/freeipsusedipswitchncpa/ and will be called ip-172-31-94-235.ec2.internal.xml and ip-172-31-94-235.ec2.internal.rrd
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked