Change computed0 to Custom Value
Posted: Thu Jun 27, 2019 6:06 pm
Hi All,
I am using the mssql plugin to generate a database query to return a single value, it is working fine. I would like to know how to customise the returned field name so it does not display as computed0 - which does not mean much. Can it be changed to a custom value such as "# Widgets" ?
/usr/local/nagios/libexec/check_mssql -H 192.168.0.226 --username "x" --password "y" --database COSDB --port 1433 --query "Select x from dbo.table" --result "Expected Result" --decode --warning 100000 --critical 250000 --querywarning 100000 --querycritical 250000 --result "Expected Result"
OK: Query duration=1.508998 seconds. Query result=68256|query_duration=1.508998s;100000;250000 'computed0'=68256;100000;250000
I am using the mssql plugin to generate a database query to return a single value, it is working fine. I would like to know how to customise the returned field name so it does not display as computed0 - which does not mean much. Can it be changed to a custom value such as "# Widgets" ?
/usr/local/nagios/libexec/check_mssql -H 192.168.0.226 --username "x" --password "y" --database COSDB --port 1433 --query "Select x from dbo.table" --result "Expected Result" --decode --warning 100000 --critical 250000 --querywarning 100000 --querycritical 250000 --result "Expected Result"
OK: Query duration=1.508998 seconds. Query result=68256|query_duration=1.508998s;100000;250000 'computed0'=68256;100000;250000