I'm having trouble using Nagios XI to read the SQL Express database size through nsclient perfmon counters.
I have already thried the following without succes
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\$SQLEXPRESS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
Total DB Size is 0 KB | 'Total DB Size is %.0f KB'=0.000000%;10000000.000000;15000000.000000;
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\$SQLEXPRESS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\\$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
Total DB Size is 0 KB | 'Total DB Size is %.0f KB'=0.000000%;10000000.000000;15000000.000000;
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\\$$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\\\$$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL\\\$$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
Total DB Size is 0 KB | 'Total DB Size is %.0f KB'=0.000000%;10000000.000000;15000000.000000;
[root@MYNAGIOS tmp]# /usr/local/nagios/libexec/check_nt -H MYSQLSRVIP -s "MYPWD" -p 12489 -v COUNTER -l "\\\\MSSQL$SQLEXPRSS:Databases\(_Total\)\\\\Data File\(s\) Size \(KB\)","Total DB Size is %.0f KB" -w 10000000 -c 15000000
could not fetch information from server
Most probably this is an escaping issue. Can you right-click on the perf counter in the "Performance Monitor" window, and post a screenshot, showing the exact name of the counter (under the "Data" tab)? Example:
example01.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
The example you found is what I use to monitor the size of SQL Standard databases
The SQL Express seems to use another syntax, probably because of the named instance.
You do not have the required permissions to view the files attached to this post.
Here is the check_nt command I just tested and it works, but I had to restart the NSClient++ service on the PC that the SQL database is running on.
This is the command that I used in NagiosXI
-l "\MSSQL$"$"SQLEXPRESS:Databases(_Total)\Data File(s) Size (KB)","Total DB Size is %.f KB" -w 10000000 - c 15000000
If you want to run it from the command line, you will have to change it to add more escaping. See the next line. Note the double back slashes.
/usr/local/nagios/libexec/check_nt -H 192.168.5.223 -s "password" -p 12489 -v COUNTER -l "\\MSSQL$"$"SQLEXPRESS:Databases(_Total)\\Data File(s) Size (KB)","Total DB Size is %.f KB" -w 10000000 -c 15000000
Try it out and post back if it works or not.
Be sure to check out our Knowledgebase for helpful articles and solutions!