Page 1 of 1

Nagios adds characters to SQL Data from VBS Script

Posted: Tue Jan 06, 2015 5:14 am
by warnox
Hi,

I'm using a Backup Exec VBS script, http://exchange.nagios.org/directory/Pl ... ec/details, to query if a Backup Job has failed. The script works fine but the output from Nagios adds in extra characters wherever there is a space in the SQL output.

In the output below, the string 'Error on backup job' is inserted by the VBS script just as a string, while 'Job Failed' comes from a SQL query.

Running the script locally

Code: Select all

C:\Program Files\NSClient++\scripts>cscript be_test.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Error on backup job | Job Failed
Executing the script from Nagios

Code: Select all

[root@nagios sysadmin]# /usr/local/nagios/libexec/check_nrpe -H xx.xx.xx.xx -c be_test
Error on backup job |'Job'=0 'Failed'=0
It looks like when the script is executed from Nagios it adds ' '=0 around every word which is separated by a space. Although this is only for results which are returned from SQL.

Nagios Core 4.0.8
NSClient 0.4.1.105

Thanks for any help.

Re: Nagios adds characters to SQL Data from VBS Script

Posted: Tue Jan 06, 2015 11:32 am
by abrist
warnox wrote:Error on backup job | Job Failed
What is the intent of this output? As per the nagios plugin spec, anything after the pipe will be processed as performance data. Performance data has the format:
'label'=value[UOM];[warn];[crit];[min];[max]
From: https://nagios-plugins.org/doc/guidelines.html#AEN200

Essentially, "Job Failed" is not valid performance data.

Re: Nagios adds characters to SQL Data from VBS Script

Posted: Tue Jan 06, 2015 11:51 am
by warnox
That was the issue!

The script has a line which separates some general text output using a pipe '|', which Nagios uses to separate performance data as you pointed out. I changed this to a hyphen '-' and now everything is fine. I will comment on the script page so the author can adjust it.

Code: Select all

txt = "Error on backup job | " & txt
Thanks for your help.

Re: Nagios adds characters to SQL Data from VBS Script

Posted: Tue Jan 06, 2015 12:41 pm
by abrist
No problem. Happy Trails!