Problems with all sql checks since update wizard

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Problems with all sql checks since update wizard

Post 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?
Last edited by WillemDH on Wed Feb 11, 2015 1:32 pm, edited 1 time in total.
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problems with all sql checks since update wizard please

Post by abrist »

I will see if I can dig one up. Are you doing any sort of escaping in your checks (for $ signs etc)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Problems with all sql checks since update wizard please

Post 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
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problems with all sql checks since update wizard please

Post by abrist »

When you recover the old one, lets diff them.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Problems with all sql checks since update wizard

Post 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.
Last edited by WillemDH on Wed Feb 11, 2015 3:26 pm, edited 1 time in total.
Nagios XI 5.8.1
https://outsideit.net
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Problems with all sql checks since update wizard

Post by WillemDH »

HMm when I add another ; again, I get

Code: Select all

"import cPickle as pickle
^
IndentationError: expected an indented block"
Nagios XI 5.8.1
https://outsideit.net
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Problems with all sql checks since update wizard

Post 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
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Problems with all sql checks since update wizard

Post 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.
You do not have the required permissions to view the files attached to this post.
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Problems with all sql checks since update wizard

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
bdgoecke
Posts: 36
Joined: Wed Oct 22, 2014 3:41 pm

Re: Problems with all sql checks since update wizard

Post 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
Locked