Page 1 of 2

Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 12:33 pm
by WillemDH
"/usr/local/nagios/libexec/check_mssql_database.py" has been updated? I updated all components and wizards and now all my sql checks are failing. Please help.

(No output on stdout) stderr: File "/usr/local/nagios/libexec/check_mssql_database.py", line 29

Could I get a link to the old version asap pls?

Re: Problems with all sql checks since update wizard please

Posted: Wed Feb 11, 2015 12:43 pm
by abrist
I will see if I can dig one up. Are you doing any sort of escaping in your checks (for $ signs etc)

Re: Problems with all sql checks since update wizard please

Posted: Wed Feb 11, 2015 12:47 pm
by WillemDH
Andy,

No escaping, this is the argument I'm passing for one such check that is failing.

Command: $USER1$/check_mssql_database.py -H $HOSTADDRESS$ $ARG1$

$ARG1$

Code: Select all

-U 'nagios_sql' -P 'password' -T 'NFPT' -I NFIT --activetrans
My backup colleague can give me a version of yesterday in 1,5 hours, there is a chance we did some edits in the script, but this has been a very long time ago, so there might not be an issue with the update. I'll be sure in about 2 hours.

Grtz

Re: Problems with all sql checks since update wizard please

Posted: Wed Feb 11, 2015 12:51 pm
by abrist
When you recover the old one, lets diff them.

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 3:13 pm
by WillemDH
Restored the backup and it works again. DId a diff, but I don't see immediately where the issue could be.... I don't find any custom changes we might have done..

Logicall the issue must be in this line:

Code: Select all

  stdout = '%s%s|%s=%s%s;%s;%s;;;' % (prefix, stdout, label, strresult, unit, options.warning or '', options.critical or '')

as we only use 2 checks for each database, active transactions and database size. As there have been no changes to the database size part, the issue should be in that part of the code. There is one less ; in the updated version.

Any idea why this was changed? I'm gonna test editing the updated version and remove add the ; again.

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 3:20 pm
by WillemDH
HMm when I add another ; again, I get

Code: Select all

"import cPickle as pickle
^
IndentationError: expected an indented block"

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 3:26 pm
by WillemDH
Ok, after adding a ; and indenting the import pickle blocks, somehow it worked again. I attached the working version in this thread. It might be a good idea to let the developer take a look.

Grtz

Willem

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 3:37 pm
by WillemDH
Ok, it seems like perfdata is no longer working for all the MSSQL Database checks, but it already stopped working 23/12 it seems. Any tips to get the graphs working again?
This is example perfdata from the last check result for active tranasctions:

Code: Select all

Performance Data:	log_file_usage=0.0;;;;;
and for db size:

Code: Select all

KB=31715264.0;;;;;
See screenshots for an overview of last year active transactions and dbsize for one example db.

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 4:19 pm
by abrist
Can you grab a tail of the npcd and parfdata logs:

Code: Select all

tail -25 /usr/local/nagios/var/npcd.log
tail -25 /usr/local/nagios/var/perfdata.log

Re: Problems with all sql checks since update wizard

Posted: Wed Feb 11, 2015 4:34 pm
by bdgoecke
Try and take out a ';'
That was the change, it was reported that an extra ';' was breaking the performance data.
Per
'label'=value[UOM];[warn];[crit];[min];[max]
(no trailing ';')

Not sure where the indentation got reformat... Will fixx that.

==>brian.

Also, what is version of the MSSQL Database Wizard that you are currently using? (Admin->Manage Config Wizards)
lmiltchev