Page 2 of 5

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

Posted: Thu Nov 21, 2019 5:10 am
by epixelitsupport
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

Posted: Thu Nov 21, 2019 2:36 pm
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.

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

Posted: Fri Nov 22, 2019 5:12 am
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

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

Posted: Fri Nov 22, 2019 11:50 am
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.

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

Posted: Fri Nov 22, 2019 1:14 pm
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?

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

Posted: Fri Nov 22, 2019 2:42 pm
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

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

Posted: Sat Nov 23, 2019 7:08 am
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

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

Posted: Mon Nov 25, 2019 9:51 am
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...

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

Posted: Mon Nov 25, 2019 10:38 am
by epixelitsupport
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

Posted: Mon Nov 25, 2019 10:51 am
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?