Hi,
We are running
NagiosXI 5.5.9 as a vmware image
We use nrpe for all our linux monitoring. Wanted to tryout ncpa.
https://assets.nagios.com/downloads/ncp ... g-NCPA.pdf
followed this document and installed NCPA on a SUSE 12 linux box
<hostname>:~ # rpm -qa | grep ncpa
ncpa-2.1.7-1.x86_64
<hostname>:~ #
Was able to use the NCPA wizard and configure the server for monitoring the basic default cpu, memory and all that and it works fine.
but if i run the command from the NagiosXI server on command line it does not work.
root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t '<token>' -P 5693 -M cpu/percent -w 20 -c 40 -q 'aggregate=avg'
UNKNOWN: Execution exceeded timeout threshold of 60s
root@nagiosxi:/usr/local/nagios/libexec#
root@nagiosxi:/usr/local/nagios/libexec# nmap <hostname> -p 5693
Starting Nmap 6.47 ( http://nmap.org ) at 2019-10-25 15:47 CDT
Nmap scan report for <hostname> (XX.XX.XX.XX)
Host is up (0.00034s latency).
PORT STATE SERVICE
5693/tcp open unknown
MAC Address: XX:XX:XX:XX:XX:XX (VMware)
Nmap done: 1 IP address (1 host up) scanned in 0.04 seconds
root@nagiosxi:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_ncpa.py -V
check_ncpa.py, Version 1.1.3
root@nagiosxi:/usr/local/nagios/libexec# /usr/local/nagios/libexec/check_ncpa.py -H <hostname> -t '<token>' -P 5693 -M system/agent_version
UNKNOWN: Execution exceeded timeout threshold of 60s
root@nagiosxi:/usr/local/nagios/libexec#
root@nagiosxi:/usr/local/nagios/libexec# su -c "whoami" - nagios
nagios
root@nagiosxi:/usr/local/nagios/libexec# su -c "/usr/local/nagios/libexec/check_ncpa.py -H <hostname> -t '<token>' -P 5693 -M system/agent_version" - nagios
UNKNOWN: Execution exceeded timeout threshold of 60s
root@nagiosxi:/usr/local/nagios/libexec#
ncpa command line not working
ncpa command line not working
You do not have the required permissions to view the files attached to this post.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: ncpa command line not working
Hello @sampaths,
Typically, if there's a timeout issue it is network related, especially since the commands are working from the Nagios web interface.
Try testing from the command line again but increase timeout value to more than 60 seconds, and add the verbose option to print additional error messages. Post any error messages to the thread.
Typically, if there's a timeout issue it is network related, especially since the commands are working from the Nagios web interface.
Try testing from the command line again but increase timeout value to more than 60 seconds, and add the verbose option to print additional error messages. Post any error messages to the thread.
Code: Select all
./check_ncpa.py -H 192.168.5.23 -t 'welcome' -P 5693 -M system/agent_version -T 120 -v
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: ncpa command line not working
Getting timeout even after increasing the time
root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t <token> -P 5693 -M system/agent_version -T 120 -v
Connecting to: https://<hostname>:5693/api/system/agent_version/?token=<token>&check=1
An error occurred:<urlopen error [Errno 110] Connection timed out>
root@nagiosxi:/usr/local/nagios/libexec#
root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t <token> -P 5693 -M system/agent_version -T 120 -v
Connecting to: https://<hostname>:5693/api/system/agent_version/?token=<token>&check=1
An error occurred:<urlopen error [Errno 110] Connection timed out>
root@nagiosxi:/usr/local/nagios/libexec#
Re: ncpa command line not working
Are you sure that you are using the same hostname in the command line as the one used in the GUI? Have you tried using an ip address instead of a hostname (FQDM)? Do you see any errors in the "ncpa_listener.log"?root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t <token> -P 5693 -M system/agent_version -T 120 -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: ncpa command line not working
Hi lmiltchev, sent a PM to you with the actual hostnames and stuff.
Re: ncpa command line not working
Replied via PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: ncpa command line not working
Thank you @lmiltchev for helping us fix the issue.
There was a proxy setup in the env, unsetting them fixed the issue.
unset {http,https,ftp}_proxy
unset {HTTP,HTTPS,FTP}_PROXY
Now it works in command line.
root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t <token> -P 5693 -M system/agent_version -T 120 -v
Connecting to: https://<hostname>:5693/api/system/agent_version/?token=<token>&check=1
File returned contained:
{
"perfdata": "",
"returncode": 0,
"stdout": "OK: Agent_version was ['2.1.7']"
}
OK: Agent_version was ['2.1.7']
root@nagiosxi:/usr/local/nagios/libexec#
There was a proxy setup in the env, unsetting them fixed the issue.
unset {http,https,ftp}_proxy
unset {HTTP,HTTPS,FTP}_PROXY
Now it works in command line.
root@nagiosxi:/usr/local/nagios/libexec# ./check_ncpa.py -H <hostname> -t <token> -P 5693 -M system/agent_version -T 120 -v
Connecting to: https://<hostname>:5693/api/system/agent_version/?token=<token>&check=1
File returned contained:
{
"perfdata": "",
"returncode": 0,
"stdout": "OK: Agent_version was ['2.1.7']"
}
OK: Agent_version was ['2.1.7']
root@nagiosxi:/usr/local/nagios/libexec#
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: ncpa command line not working
Hello @sampths,
Great. Thanks for the update and solution.
We'll go ahead and close this out but feel free to open another if you have any new questions.
Great. Thanks for the update and solution.
We'll go ahead and close this out but feel free to open another if you have any new questions.
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!