Nagios and NCPA communication issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Nagios and NCPA communication issue

Post by nickanderson82 »

I can't get my windows servers to communicate to my nagios core server.

I have nagios 4.0 installed
I updated the plugins
I configured NCPA 2.0
I added the check_ncpa.py and ncpa.cfg

I can view the nrdp test page on the client but when I test the toke I get:
<?xml version="1.0" encoding="UTF-8"?>
-<result>
<status>-1</status>
<message>BAD CHECK RESULTS DIR</message>
</result>

I can access nagios through a web interface but the only success I had was adding a url to monitor.

I just need some guidance on how to troubleshoot this setup. Any assistance would be great.
kyang

Re: Nagios and NCPA communication issue

Post by kyang »

Hello @nickanderson82,

Are you using CentOS?

So just to be sure, you installed NCPA on your windows server or Linux server?

Are you using NRDP or NCPA? OR both? NRDP is for passive checks. I'm not exactly sure what you want to do.

Are you able to access the NCPA web interface?

Let me know some more details so I can help you better.

When you create the ncpa.cfg you have to add the path to your nagios.cfg file. (I'm not exactly sure how far you are, but any of the above information will help us!)
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Re: Nagios and NCPA communication issue

Post by nickanderson82 »

Are you using CentOS?
RHEL 7

So just to be sure, you installed NCPA on your windows server or Linux server?
NCPA installed on Windows Server

Are you using NRDP or NCPA? OR both? NRDP is for passive checks. I'm not exactly sure what you want to do.
I guess I'm using both. I just wanted to be able to monitor hardware and some services on the servers

Are you able to access the NCPA web interface?
Yes , I can access that on the client Server I am testing

Let me know some more details so I can help you better.

When you create the ncpa.cfg you have to add the path to your nagios.cfg file. (I'm not exactly sure how far you are, but any of the above information will help us!)
I have not done that yet, do I add it under specify individual object config files or under definitions for monitoring a windows machine?
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Re: Nagios and NCPA communication issue

Post by nickanderson82 »

So after adding it under specify individual object config files I am able to see
NCPA 2 Host status is down, so it appears to be checking but not finding anything or listing server names/ips
I added what the site said and only modified the 'mytoken' to xxxxx (my token I created). I am assuming I need to do more then?

ncpa.cfg:
define host {
host_name NCPA 2 Host
address 192.168.1.10
check_command check_ncpa!-t 'mytoken' -P 5693 -M system/agent_version
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts nagiosadmin
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1
}

define service {
host_name NCPA 2 Host
service_description CPU Usage
check_command check_ncpa!-t 'mytoken' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name NCPA 2 Host
service_description Memory Usage
check_command check_ncpa!-t 'mytoken' -P 5693 -M memory/virtual -w 50 -c 80 -u G
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}

define service {
host_name NCPA 2 Host
service_description Process Count
check_command check_ncpa!-t 'mytoken' -P 5693 -M processes -w 150 -c 200
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
contacts nagiosadmin
register 1
}
kyang

Re: Nagios and NCPA communication issue

Post by kyang »

Is this your windows server address?

Code: Select all

192.168.1.10
If not, change the address.

Also, did you allow port 5693 on your Nagios server?
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Re: Nagios and NCPA communication issue

Post by nickanderson82 »

I am thinking I did not allow port 5693. I will do that.
But when you say change the ip to the (client) server IP... Do you have to add all the servers that you want monitored? I was assuming this would dynamically start identifying all servers that had ncpa installed on them. Is their a way to set that up?
kyang

Re: Nagios and NCPA communication issue

Post by kyang »

Since you are using Core, you would have to manually replace the IP address of your client (windows server) into that ncpa.cfg file.

I'm not sure of a way to set that up in Core, it's usually just manually create cfg files for a host --> define the host and services --> then add the path of the cfg file into the nagios.cfg.

So if you had Multiple services with NCPA installed, you could just copy that ncpa.cfg into a new name and change the IP address of that.

The NCPA help documentation can also help answer other questions.
https://www.nagios.org/ncpa/help.php
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Re: Nagios and NCPA communication issue

Post by nickanderson82 »

That was exactly the issue. Once i added to the Nagios.cfg it worked fine. Thank You.
kyang

Re: Nagios and NCPA communication issue

Post by kyang »

Sounds great!

Do you have any more questions or are we okay to close this thread?
nickanderson82
Posts: 29
Joined: Wed Sep 27, 2017 11:27 am

Re: Nagios and NCPA communication issue

Post by nickanderson82 »

You can close the thread. Thank You for the quick responses. I apologize for the delayed success response.
Locked