lausser / check_mssql_health

Wenn du dich für Plugins (oder OMD oder allgemein Monitoring) interessierst oder von deiner Installation erzählen willst...die Tradition der deutschsprachigen Monitoring-Workshops wird wiederbelebt: https://discord.gg/jDfPZ63FcJ A plugin, which checks various parameters of Microsoft SQL database servers.
http://labs.consol.de/nagios/check_mssql_health
GNU General Public License v2.0
38 stars 27 forks source link

possible improvement #13

Open candymanuu opened 9 years ago

candymanuu commented 9 years ago

Hi,

It would be a good thing to add a parameter that checks how many databases were found and compares it to how many databases were requested. It happened (not only once) that some databases were missing and everybody thought they were OK :laughing:

E.g.: I want to find out database transactions

/usr/local/nagios/libexec/check_mssql_health --server server --username nagios --password blabla --mode transactions --warning 10 --critical 15 --name='^((master|tempdb|testdatabase))' --regexp --commit OK - tempdb has 0.0000 transactions / sec, master has 0.0000 transactions / sec | tempdb_transactions_per_sec=0.0000;10;15 master_transactions_per_sec=0.0000;10;15

As it can be seen, I submitted 3 databases for check, but got results for only 2 of them.

I think it would be a good improvement to double check how many databases were requested and how many databases were found and give a Warn / Crit message saying something like: you requested 7 databases but only 5 were found.

historicbruno commented 9 years ago

But that name is only a regex pattern, it wouldn't be practical to determine how many databases should be found from that (IMO) because a slightly different pattern could have arbitrarily many results. However, I could see the value in a new option like --expected-database-count or similar, that may be what you were requesting anyway :)

candymanuu commented 9 years ago

I know it is a regex pattern.

Example: on a project, I was given the above regex to monitor those 3 databases. The admins were expecting that Nagios would monitor 3 databases ... only that someone deleted a DB and no one knew about it, Nagios never reported any error because database was not found. And they all thought everything is OK, all 3 databases are working, when in fact, 1 DB was deleted :smile:

A "--expected-database-count" or something similar, would have helped because it we would have been notified that 1 DB is missing.

Of course, not everybody would need this option ... that's why I said "possible improvement" :wink: