Option to monitor or check custom made services in Ubuntu

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.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Option to monitor or check custom made services in Ubunt

Post by epixelitsupport »

what are the changes i need to do it in nagios core server? after installing ncpa in clinet machine ?
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Option to monitor or check custom made services in Ubunt

Post by mbellerue »

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!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Option to monitor or check custom made services in Ubunt

Post by epixelitsupport »

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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Option to monitor or check custom made services in Ubunt

Post by mbellerue »

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!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Option to monitor or check custom made services in Ubunt

Post by epixelitsupport »

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?
Attachments
this is the processes
this is the processes
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Option to monitor or check custom made services in Ubunt

Post by lmiltchev »

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?

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!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Option to monitor or check custom made services in Ubunt

Post by epixelitsupport »

I'm given the execute permission for the file in client-server for the script

Please find the Attachment for a clear view
Attachments
output while rennung command
output while rennung command
script in client machine
script in client machine
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Option to monitor or check custom made services in Ubunt

Post by lmiltchev »

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:

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'
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...
Be sure to check out our Knowledgebase for helpful articles and solutions!
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: Option to monitor or check custom made services in Ubunt

Post by epixelitsupport »

Yes im getting the output , the thing is how can i get it reflected in my nagios server dashboard?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Option to monitor or check custom made services in Ubunt

Post by lmiltchev »

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!
Locked