NCPA & NRDP on Nagios Core Help please
Re: NCPA & NRDP on Nagios Core Help please
Hello
Checked Token etc. and all works fine from NRDP Web interface on the child Server.
Decreased the time to 50 abd restarted the service but the NCPA agent has been running since yesterday still nothing getting to the log file
sudo dpkg -l selinux* returns in selinux-policy-default none none no description available
Checked the log again and still nothing.
Checked Token etc. and all works fine from NRDP Web interface on the child Server.
Decreased the time to 50 abd restarted the service but the NCPA agent has been running since yesterday still nothing getting to the log file
sudo dpkg -l selinux* returns in selinux-policy-default none none no description available
Checked the log again and still nothing.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NCPA & NRDP on Nagios Core Help please
@Slodge123, There's a PowerShell script you can run on windows to send NRDP check result manually from the windows host to Nagios. This will be very helpful in our case.
1. Extract the script called ps_nrdp.ps1 from the zip file that I attached.
2. Put the script somewhere on your Windows computer, like in C://
3. Open Windows Powershell as administrator (you can search for it in windows search, it's a default program).
4. Type Set-ExecutionPolicy RemoteSigned to allow PowerShell script execution
5. Navigate to the folder where your script is and run it:
6. You should see something like:
Great!
On your nagios server run tail -f /usr/local/nagios/var/nagios.logtail -f /usr/local/nagios/var/nagios.logto live track incoming nrdp data.
Do you see anything now?
Also, in your ncpa.cfg file on windows change:
Restart Ncpa service.
And on Nagios server check for these log files. There could be some debugging information in there as well.
1. Extract the script called ps_nrdp.ps1 from the zip file that I attached.
2. Put the script somewhere on your Windows computer, like in C://
3. Open Windows Powershell as administrator (you can search for it in windows search, it's a default program).
4. Type Set-ExecutionPolicy RemoteSigned to allow PowerShell script execution
5. Navigate to the folder where your script is and run it:
Code: Select all
.\ps_nrdp.ps1 -url http://YOUR_NAGIOS_IP -token YOUR_TOKEN -hostname test -service test -state OK -output test -delim 1
Code: Select all
SUCCESS - checks succesfully sent, NRDP returned: <?xml version="1.0" encoding="utf-8"?>
<result>
<status>0</status>
<message>OK</message>
<meta>
<output>1 checks processed.</output>
</meta>
</result>
)
On your nagios server run tail -f /usr/local/nagios/var/nagios.logtail -f /usr/local/nagios/var/nagios.logto live track incoming nrdp data.
Do you see anything now?
Also, in your ncpa.cfg file on windows change:
Code: Select all
#
loglevel =debug
logfile = var/log/ncpa_listener.log
pidfile = var/run/ncpa_listener.pid
#
And on Nagios server check for these log files. There could be some debugging information in there as well.
- Attachments
-
- psnrdp-master.zip
- (12.16 KiB) Downloaded 232 times
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NCPA & NRDP on Nagios Core Help please
With all your help I stumbled across this article https://support.nagios.com/forum/viewto ... 9&start=20 which said I needed to install php-simplexml because my server runs on Ubuntu, Did this and I am now getting the expected "Error: Got check" errors from the remote host.
I guess all I need to do now is put the checks somewhere in a config file, any pointers to what goes where greatly appreciated
I guess all I need to do now is put the checks somewhere in a config file, any pointers to what goes where greatly appreciated
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NCPA & NRDP on Nagios Core Help please
@Slodge123 , Glad it worked! Yes, we've got the most important part out of the way and we only need to create host/services definitions.
On your Nagios Server:
Navigate to:
Open the file called templates.cfg and paste the following code in HOST TEMPLATES section:
And paste the following code in SERVICE TEMPLATES section:
Save and exit out of the file.
In the same directory /usr/local/nagios/etc/objects
Create a new file new_host.cfg
And add this code inside(you can change the host name to whatever you like):
Save and exit out of the file.
Then go to: /usr/local/nagios/etc/
And modify the file called nagios.cfg
Add your new config path in this section:
Add this
cfg_file=/usr/local/nagios/etc/objects/new_host.cfg
Save and exit.
Run
Should be all done.
On your Nagios Server:
Navigate to:
Code: Select all
/usr/local/nagios/etc/objects
Code: Select all
define host {
use generic-host
name passive_host
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
register 0
check_period 24x7
max_check_attempts 1
check_interval 5
retry_interval 1
check_freshness 0
contact_groups admins
check_command check_dummy!0
notification_interval 60
notification_period 24x7
notification_options d,u,r
}
Code: Select all
define service {
use generic-service
name passive_service
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
register 0
check_period 24x7
max_check_attempts 1
check_interval 5
retry_interval 1
check_freshness 0
contact_groups admins
check_command check_dummy!0
notification_interval 60
notification_period 24x7
notification_options w,u,c,r
}
In the same directory /usr/local/nagios/etc/objects
Create a new file new_host.cfg
And add this code inside(you can change the host name to whatever you like):
Code: Select all
define host {
use passive_host
host_name S1601
}
define service {
use passive_service
service_description CPU Usage
host_name S1601
}
define service {
use passive_service
service_description Disk Usage
host_name S1601
}
define service {
use passive_service
service_description Swap Usage
host_name S1601
}
define service {
use passive_service
service_description Memory Usage
host_name S1601
}
define service {
use passive_service
service_description Process Count
host_name S1601
}
Then go to: /usr/local/nagios/etc/
And modify the file called nagios.cfg
Add your new config path in this section:
Code: Select all
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
cfg_file=/usr/local/nagios/etc/objects/remotehost.cfg
cfg_file=/usr/local/nagios/etc/objects/new_host.cfg
Save and exit.
Run
Code: Select all
service nagios restart
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NCPA & NRDP on Nagios Core Help please
Added to the files as per your post.
When I restart the Nagios service it fails to restart, when I check the config by /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg i get the following errors
Error: Service check command 'check_dummy!0' specified in service 'CPU Usage' for host 'Enter123' not defined anywhere
I get the same for all 5 checks ie CPU Usage, Disk, Memory, Process & Swap
I also get Error: Host check command 'check_dummy!0' specified for host 'Enter123' is not defined anywhere!
Thanks again for your advice and help,
When I restart the Nagios service it fails to restart, when I check the config by /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg i get the following errors
Error: Service check command 'check_dummy!0' specified in service 'CPU Usage' for host 'Enter123' not defined anywhere
I get the same for all 5 checks ie CPU Usage, Disk, Memory, Process & Swap
I also get Error: Host check command 'check_dummy!0' specified for host 'Enter123' is not defined anywhere!
Thanks again for your advice and help,
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NCPA & NRDP on Nagios Core Help please
@Slodge123 I appologize i missed one part:
Please open this file:
/usr/local/nagios/etc/objects/commands.cfg
And paste this definition anywhere in the Sample Service Checks Commands:
Here's the reference just in case: https://support.nagios.com/kb/article/n ... tions.html
Please open this file:
/usr/local/nagios/etc/objects/commands.cfg
And paste this definition anywhere in the Sample Service Checks Commands:
Code: Select all
define command {
command_name check_dummy
command_line $USER1$/check_dummy $ARG1$
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NCPA & NRDP on Nagios Core Help please
I cant thank you enough
I am now seeing the passive check results in the Nagios Dashboard
I am now seeing the passive check results in the Nagios Dashboard
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NCPA & NRDP on Nagios Core Help please
@Slodge123, Nice! Not a problem I will go ahead and lock this topic but if you'll have any other problems feel free to create a new one.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.