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.

Option to monitor or check custom made services in Ubuntu

Postby epixelitsupport » Fri Nov 08, 2019 3:08 am

Option to monitor or check custom made services in Ubuntu,

I am using a nagios Core latest version, I need to monitor services which I have custom made in client machine.
I have a created a service in systemd , is there any option to monitor those services whether it is running or stopped,
let me get a solution for it
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 08, 2019 11:29 am

You can always write a simple bash script to run systemctl status servicename, and then return the proper exit code based on the result. That script can then be called using the check_by_ssh plugin from the Nagios server.

Or if you want a more robust solution, check out the Nagios Cross Platform Agent. You can install this on Windows, Linux, MacOS, AIX, or Solaris, and you will have access to a host of built in monitoring features, as well as a way to execute custom plugins.
https://www.nagios.org/ncpa/
https://www.nagios.org/ncpa/getting-started.php
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: 878
Joined: Fri Jul 12, 2019 11:10 am

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

Postby epixelitsupport » Sat Nov 09, 2019 8:57 am

Thanks for your reply and suggestion.
As you can in the attachment my Nagios server monitoring a lot of client machines and each client machines having different types of services, I just want to create a notification here as we seen here like services here already like apache, users and disks so if the services stopped I will get a mail notification as well... now some services are stopping in the client machines without any notification and I came to know about the issue only after informed by the client and Can you suggest me a solution to get rid of this issue which I'm facing now
Thank you in advance for your kind support
Attachments
nagiosclinets.png
monitoringclieentsandservices
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby mbellerue » Mon Nov 11, 2019 12:18 pm

Either of the options mentioned above will be able to monitor a custom service. For simplicity, it may be easiest to use NCPA. NCPA will handle listing out the services, and all you have to do is tell Nagios which service you want to make sure is running.
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: 878
Joined: Fri Jul 12, 2019 11:10 am

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

Postby epixelitsupport » Wed Nov 13, 2019 1:46 am

So can I integrate NCPA with Nagios Core?
Means can I monitor from my Nagios page as itself? or do I need to create a different URL to access NCPA?

and also can you please give me an example for this one? You can always write a simple bash script to run systemctl status servicename, and then return the proper exit code based on the result. That script can then be called using the check_by_ssh plugin from the Nagios server.


Thank you for your support
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby mbellerue » Wed Nov 13, 2019 11:08 am

Yes, you can use NCPA with Nagios Core. NCPA is just an agent that will run on the server that you want to monitor. On your Nagios server, you should have /usr/local/nagios/libexec/check_ncpa.py which will be used to check various aspects of the remote server. Make sure to read the getting started documentation for NCPA so you know how to configure it.
https://www.nagios.org/ncpa/getting-started.php#linux

Example bash script
Code: Select all
#!/bin/bash

systemctl status yourservicename

exit $?


Put that script on the remote server in /usr/local/ncpa/plugins/ and then test out the check_ncpa.py command on Nagios, like so.

/usr/local/nagios/libexec/check_ncpa.py -H HostNameOrIP -t secretpassword -M plugins/example_script.sh
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: 878
Joined: Fri Jul 12, 2019 11:10 am

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

Postby epixelitsupport » Wed Nov 20, 2019 7:32 am

Do i need to install ncpa on both systems? like Nagios server and Client machine?
Im already installed everything in the nagios core server machine ..
Please give me an instruction to install NCPA on Nagios Ser machine and Client (host) machine


Im using an ubuntu 18.04 machine as a nagios server
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby mbellerue » Wed Nov 20, 2019 10:24 am

You will only need NCPA on the client machine that you want to monitor. Nagios Core will reach out to that server and query NCPA for information.

Here are the instructions for installing NCPA on Linux.
https://www.nagios.org/ncpa/getting-started.php#linux
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: 878
Joined: Fri Jul 12, 2019 11:10 am

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

Postby epixelitsupport » Wed Nov 20, 2019 10:51 am

I see, So i just want to install it in https://www.nagios.org/ncpa/getting-started.php#linux client machine only right?
so how the Nagios machine will contact the Client machine?

Where do i perform the task as i mentioned in attachment
Attachments
nagioscomm.png
wheredoi perform this task
epixelitsupport
 
Posts: 19
Joined: Fri Nov 08, 2019 2:40 am

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

Postby mbellerue » Wed Nov 20, 2019 1:15 pm

Yes, NCPA is only installed on the client machine.

The tasks in that attachment have you working with your Nagios configuration files. By default they are in /usr/local/nagios/etc/ and /usr/local/nagios/etc/objects/
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: 878
Joined: Fri Jul 12, 2019 11:10 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 21 guests