Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible improvement #13

Open
candymanuu opened this issue Feb 6, 2015 · 2 comments
Open

possible improvement #13

candymanuu opened this issue Feb 6, 2015 · 2 comments

Comments

@candymanuu
Copy link

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 😆

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
Copy link

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
Copy link
Author

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 😄

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" 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants