Comments (5)
this little patch works for me (internal_name doesn't exist). Version 2.6.4.15, I ignored a different section that never prints internal_name.
--- check_mssql_health 2019-09-25 11:17:46.608776257 -0700
+++ check_mssql_health.new 2020-10-15 10:19:58.710809895 -0700
@@ -2045,7 +2045,7 @@
# FAN_459,FAN_203,TEMP_102229,ENVSUBSYSTEM
if ($self->opts->blacklist =~ /_/) {
foreach my $bl_item (split(/,/, $self->opts->blacklist)) {
- if ($bl_item eq $self->internal_name()) {
+ if (exists $self->{name} && $bl_item eq $self->{name}) {
$self->{blacklisted} = 1;
}
}
@@ -2055,12 +2055,12 @@
my $bl_type = $1;
my $bl_names = $2;
foreach my $bl_name (split(/,/, $bl_names)) {
- if ($bl_type."_".$bl_name eq $self->internal_name()) {
+ if ($bl_type."_".$bl_name eq $self->{name}) {
$self->{blacklisted} = 1;
}
}
} elsif ($bl_items =~ /^(\w+)$/) {
- if ($bl_items eq $self->internal_name()) {
+ if ($bl_items eq $self->{name}) {
$self->{blacklisted} = 1;
}
}
from check_mssql_health.
from check_mssql_health.
I need to sanitize it a little bit, so fake database names and I got tired of editing so the number of errors may not line up with the number of "online" databases.
I had to do if (exists $self->{name} &&
because for some reason it started the loop on an empty database name.
before:
-bash-4.2$ ./check_mssql_health.20201015 --server myserver --username nagiosro --password password --mode database-online --commit --multiline --blacklist 'BAD_DATABASE'
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
Use of uninitialized value in string eq at ./check_mssql_health.20201015 line 2048.
CRITICAL - BAD_DATABASE is offline, tempdb is online and accepting connections
db1 is online and accepting connections
db2 is online and accepting connections
db3 is online and accepting connections
db4 is online and accepting connections
db5 is online and accepting connections
db6 is online and accepting connections
db7 is online and accepting connections
db8 is online and accepting connections
db9 is online and accepting connections
db10 is online and accepting connections
db11 is online and accepting connections
db12 is online and accepting connections
db13 is online and accepting connections
db14 is online and accepting connections
db15 is online and accepting connections
After the patch:
-bash-4.2$ ./check_mssql_health --server myserver --username nagiosro --password password --mode database-online --commit --multiline --blacklist 'BAD_DATABASE'
OK - tempdb is online and accepting connections
db1 is online and accepting connections
db2 is online and accepting connections
db3 is online and accepting connections
db4 is online and accepting connections
db5 is online and accepting connections
db6 is online and accepting connections
db7 is online and accepting connections
db8 is online and accepting connections
db9 is online and accepting connections
db10 is online and accepting connections
db11 is online and accepting connections
db12 is online and accepting connections
db13 is online and accepting connections
db14 is online and accepting connections
db15 is online and accepting connections
from check_mssql_health.
from check_mssql_health.
good to know about the regex option. If you want to keep it like that, possibly improve your documentation, and remove the broken functionality ("internal_name" is still nonexistent in the script). note that --blacklist was the intuitive option for me and probably the same for this issue's reporter.
I just wanted a quick fix when a database was intentionally turned off and I didn't want to create individual checks for every single database that was still running. :)
from check_mssql_health.
Related Issues (20)
- SQL Server Express 2014 check_mssql_health with on LibreNMS HOT 12
- sql-runtime does not work on v 2.6.4.10 HOT 1
- DBD:SYBASE Change to BBDD Mysql HOT 1
- failed-jobs undefined value as array on Microsoft SQL Server 2000 SP4 HOT 1
- Class MyDatabases is not a subclass of Monitoring::GLPlugin HOT 10
- Adaptive Server connection failed with V2.6.4.13 HOT 2
- need encoding...
- Not working in SQLServer 2016 HOT 1
- Fail at user creation HOT 1
- configure does not exist
- Mode xxxxx is not implemented for this type of device
- connected_users should be connected_sessions
- Read query from file with SQL Mode HOT 1
- Database offline/deleted but Check status OK HOT 3
- Database not accepting connections - Because of "Auto Close"
- doesn't support Azure MSSQL
- The database-log-free mode does not show the correct free log space it has left
- No connect to MSSQL Server 2022 HOT 1
- Backup Status alerts on multiple Availability Groups when split over 2 or more hosts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from check_mssql_health.