check_mssql_database gives type 'exceptions.ValueError' erro

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
christophermark
Posts: 3
Joined: Thu May 10, 2018 7:14 am

check_mssql_database gives type 'exceptions.ValueError' erro

Post by christophermark »

Hi,

I am hoping someone can help with this issue I having with the "check_xi_mssql_database" plugin. In CCM when I run the below command

Code: Select all

$USER1$/check_mssql_database.py -H $HOSTADDRESS$ $ARG1$ 
-U 'mylogin' -P '$mypassword' -T 'mydb' -p 1433 --datasize --warning 100000000 --critical 1000000000
When i run the check command in ccm it works fine and returns
OK: Database size is 1589248.0KB|KB=1589248.0;100000000;1000000000;;
My problem is when I look at my services the status shows up as unknown and the status information is "<type 'exceptions.ValueError'>" . This happens for all commands that use this plugin. Some things to note, the commands return ok when running directly from commandline, also the my password has a $ in it, but if check command works I wouldnt think this would be an issue. Thanks for the help.
christophermark
Posts: 3
Joined: Thu May 10, 2018 7:14 am

Re: check_mssql_database gives type 'exceptions.ValueError'

Post by christophermark »

I have resolved this by adding $USER9$ in resource.cfg and then using that as the parameter for the password. What I dont understand is why the check command in CCM did not give an error.
kyang

Re: check_mssql_database gives type 'exceptions.ValueError'

Post by kyang »

Hello,

I'm a bit confused, but I think you say it's mostly working from the CCM correct?

And that it also returns OK from the terminal? But it's returning that error on the UI when looking at the service status correct?

Usually since, there's a special character. Defining the password as you did in the resource.cfg is the route to go. You won't be able to call that macro through the command line ($USER9$), but Nagios XI can correct interpret that macro and use the value you assigned to it in the UI for checks.

https://assets.nagios.com/downloads/nag ... Macros.pdf

Otherwise, I'm glad you found the solution to this.
Locked