Option to monitor or check custom made services in Ubuntu
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Option to monitor or check custom made services in Ubunt
what are the changes i need to do it in nagios core server? after installing ncpa in clinet machine ?
Re: Option to monitor or check custom made services in Ubunt
In order to run a check, you need to make a check command, and then define a service that uses that check command. That is all in the screenshot that you posted earlier.
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!
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Option to monitor or check custom made services in Ubunt
i did all the things you mentioned above and it is not working for me,... I'm using aws server, so do i need to enable the port in firewall as well as im wondering how these machines are communication with each other for ncpa ?
Its showing NCPA2 host is DOWN, and Nagios monitoring is working for the same client machine perfectly
Its showing NCPA2 host is DOWN, and Nagios monitoring is working for the same client machine perfectly
Re: Option to monitor or check custom made services in Ubunt
Yes, if the server you are trying to monitor has a firewall, you will need to allow access to the NCPA port. The port is configurable, but the default port is 5693.
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!
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Option to monitor or check custom made services in Ubunt
yes well its communicatin with eachother now , But this one is not running?
/usr/local/nagios/libexec/check_ncpa.py -H HostNameOrIP -t secretpassword -M plugins/example_script.sh
How can i bring this in my Nagios check monitoring tool?
I have added the script in remote client machine and its not communicating from my Nagios Core server
How can i communicate this script from my Nagios core server to the cleint machine for the service which i have mentioned as a script?
So you mean the process Count?
please find attachment?
No Option to opt-out a particular service?
/usr/local/nagios/libexec/check_ncpa.py -H HostNameOrIP -t secretpassword -M plugins/example_script.sh
How can i bring this in my Nagios check monitoring tool?
I have added the script in remote client machine and its not communicating from my Nagios Core server
How can i communicate this script from my Nagios core server to the cleint machine for the service which i have mentioned as a script?
So you mean the process Count?
please find attachment?
No Option to opt-out a particular service?
Re: Option to monitor or check custom made services in Ubunt
Can you share your script? What are the permissions of the "example_script.sh" script?
Can you run the command below, and show the output?
Can you run the command below, and show the output?
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H HostNameOrIP -t secretpassword -M plugins/example_script.sh -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Option to monitor or check custom made services in Ubunt
I'm given the execute permission for the file in client-server for the script
Please find the Attachment for a clear view
Please find the Attachment for a clear view
Re: Option to monitor or check custom made services in Ubunt
I see one issue with your command and one potential issue...
1. You must pass an IP address or a hostname (FQDN) after the '-H' flag... ubuntu@xxx won't work at all. Use:
Read more on NCPA usage here:
https://www.nagios.org/ncpa/help.php
2. You may not have the permissions for check the status of a service. You may need to add "sudo" in front of the "systemctl status ..." command in your script, and add nagios user to sudoers file on the client. The nagios user should have the permissions to run the systemctl command...
One more thing - you don't need to have "echo $?" at the end of the script. If the service is not running, you will get a non-OK state...
1. You must pass an IP address or a hostname (FQDN) after the '-H' flag... ubuntu@xxx won't work at all. Use:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H <ip address of the remote machine> -P 5693 -t <your token> -M 'plugins/servicescript.sh'
https://www.nagios.org/ncpa/help.php
2. You may not have the permissions for check the status of a service. You may need to add "sudo" in front of the "systemctl status ..." command in your script, and add nagios user to sudoers file on the client. The nagios user should have the permissions to run the systemctl command...
One more thing - you don't need to have "echo $?" at the end of the script. If the service is not running, you will get a non-OK state...
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 85
- Joined: Fri Nov 08, 2019 2:40 am
Re: Option to monitor or check custom made services in Ubunt
Yes im getting the output , the thing is how can i get it reflected in my nagios server dashboard?
Re: Option to monitor or check custom made services in Ubunt
Can you show us a screenshot of what you currently see in the GUI? What do you expect to see, and how this is different from what you currently see on your nagios server dashboard?
Be sure to check out our Knowledgebase for helpful articles and solutions!