Monitor a table records count

Hi
I’m discovering LibreNMS.
I browsed many sites including the docs website, but didn’t found information.

I have an application using mysql database.
A table contains pending jobs.

I would like to monitor the pending jobs count.

The way I found:
I create a nagios plugins in /usr/share/nagios/plugins.
This plugin launches a script on the remote databases server with ssh.
The value returned by this script contains the pending jobs count.

Questions:
Is this the good way to get pending jobs count ? Is there a better way ?
How to store values and display it in a graph ?

Thank You for your help.

David.

Have you tried this?
http://docs.librenms.org/Extensions/Applications/#mysql

I read it before, but
Your link does not explain what are the features of this extension…

in the demo server, it shows what the Mysql app. Looks like it has what you are looking for
https://demo.librenms.org/device/device=1/tab=apps/app=mysql/
user: demo pass: demo

Seems like you should use the nagios service checks and write a nagios plugin

Edit: You already do that, so yes that’s the sane way.

Hi all !
First, I didn’t find how to create an alert or a graph from a nagios plugin.
Next, demo server only show graph from predefined queries.
These queries only are about MySQL system.
I would like to set my own query:
SELECT count(*) FROM jobs_table
David.

You can’t graph from nagios checks. You’ll need to write a custom application (see previous pull requests for more info) or use munin scripts which would be a lot easier. We have little to no docs on that, search GitHub issues for the limited IFL we do have.

Nagios check graphs are definitely a thing. LibreNMS will automatically create (somewhat generic) graphs and show it under Services >> Details on your device:

That’s the graph for “check_mailq” with the following options: -w 150 -c 300 -M postfix

1 Like

Well you learn something new every day.