Page 1 of 1
Monitoring multiple ports/services
Posted: Fri Sep 20, 2019 1:14 pm
by fsodah
What would be the best to monitor such a node running multiple services, I would like to include all these ports in under one IP without using an agent on the server, i want to know if they are up listening or not.
Host is up (0.000019s latency).
Nmap scan report for server (x.x.x.x)
Host is up (0.00065s latency).
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
3306/tcp open mysql
Re: Monitoring multiple ports/services
Posted: Fri Sep 20, 2019 1:27 pm
by mbellerue
There are plugins that come with Nagios XI that will check these services from the Nagios server, without querying an agent.
check_ssh
check_http (for both http and https)
check_mysql
If you have non-standard services that are binding to those ports, you could write a simple plugin that uses nmap to see if the port is open, open/filtered, or closed.
As an example, here is the check_http command in action.
Code: Select all
/usr/local/nagios/libexec/check_http -H www.nagios.com -p 443 --ssl
That will reach out to
http://www.nagios.com, and check to make sure it responds to HTTPS on port 443.
Re: Monitoring multiple ports/services
Posted: Fri Sep 20, 2019 1:39 pm
by fsodah
I will try it on Monday and get back to you. Thank You
Re: Monitoring multiple ports/services
Posted: Fri Sep 20, 2019 1:40 pm
by mbellerue
Alright, sounds good. We will be here.
Re: Monitoring multiple ports/services
Posted: Sun Sep 22, 2019 12:59 pm
by fsodah
Done ... due to urgent request i made it today
Re: Monitoring multiple ports/services
Posted: Mon Sep 23, 2019 8:33 am
by lmiltchev
I was going to add that you could use check_tcp (actually for all these ports), but it seems you already figured this out. Let us know if you have any further questions. Thank you!
Re: Monitoring multiple ports/services
Posted: Mon Sep 23, 2019 10:24 am
by fsodah
Many thanks please close the ticket