Page 1 of 1

How can we monitor database with dynamic port

Posted: Mon Oct 22, 2018 12:05 pm
by progressive.nagiosXI
Here we have scenario in one of our customer that they have dynamic port using in database that they want to monitor is therr any way we can do it

Re: How can we monitor database with dynamic port

Posted: Mon Oct 22, 2018 1:53 pm
by cdienger
Do you want to make sure the port is reachable or is it enough that the database process is up?

You can use NCPA to make sure the process is running:

https://www.nagios.org/ncpa/help.php#ap ... -processes

Going a step further you could also create a script that checks that the process is up and listening on a port. On a Linux system:

netstat -nap | grep mysqld | grep tcp

would return information about the port that mysqld is listening on. Details on writing custom plugins can be found at https://nagios-plugins.org/doc/guidelines.html and a tutorial at https://exchange.nagios.org/directory/T ... pt/details.