Option to monitor or check custom made services in Ubuntu

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

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

Postby epixelitsupport » Thu Nov 21, 2019 5:10 am

what are the changes i need to do it in nagios core server? after installing ncpa in clinet machine ?
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby mbellerue » Thu Nov 21, 2019 2:36 pm

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

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

Postby epixelitsupport » Fri Nov 22, 2019 5:12 am

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

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

Postby mbellerue » Fri Nov 22, 2019 11:50 am

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

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

Postby epixelitsupport » Fri Nov 22, 2019 1:14 pm

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
nagtest.png
this is the processes
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby lmiltchev » Fri Nov 22, 2019 2:42 pm

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
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!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

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

Postby epixelitsupport » Sat Nov 23, 2019 7:08 am

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

Please find the Attachment for a clear view
Attachments
nagiosserveroutpit.png
output while rennung command
scriptinclientmachine.png
script in client machine
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby lmiltchev » Mon Nov 25, 2019 9:51 am

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...
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!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

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

Postby epixelitsupport » Mon Nov 25, 2019 10:38 am

Yes im getting the output , the thing is how can i get it reflected in my nagios server dashboard?
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby lmiltchev » Mon Nov 25, 2019 10:51 am

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?
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!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: TDBruno and 21 guests