Need help on check_msmq plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Need help on check_msmq plugin

Post by bsivavani »

Hi,

We are trying to use check_msmq plugin to monitor message queue count as described in below link

https://exchange.nagios.org/directory/P ... bs/details

We were able to run the plugin from Nagios server command line and able to get the output

[nagios@XXXX ~]$ /usr/local/nagios/libexec/check_nrpe -H XXXX -p 5666 -t 30 -c check_msmq -a "MessageCount DIRECT=OS:s930a3703.group.rwe.com\private$\previewjob 50 60"
MessageCount OK - DIRECT=OS: XXXX\\private$\\previewjob: 40
|'MessageCount'=40;50;60
[nagios@ XXXX ~]$

But we are getting the below error while running from Nagios console
C:\Program Files\NSClient++\scripts\check_msmq.vbs(68, 4) Microsoft VBScript runtime error: Type mismatch: 'CInt'

Nagios Service definition
define service {
host_name XXXX
service_description Monitoring_PROD_MSMQ_Queue
check_command check_win_msmq!'MessageCount DIRECT=OS:XXXX\private$\previewjob 50 60'!!!!!!!
max_check_attempts 3
check_interval 2
retry_interval 2
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
notification_options c,
notifications_enabled 0
register 1
}

Kindly help us on how to resolve this error ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Need help on check_msmq plugin

Post by ssax »

Please try changing this:

Code: Select all

'MessageCount DIRECT=OS:XXXX\private$\previewjob 50 60'
To this:

Code: Select all

'MessageCount DIRECT=OS:XXXX\private\$$\previewjob 50 60'
Or this:

Code: Select all

"MessageCount DIRECT=OS:XXXX\private$"$"\previewjob 50 60"
Note: Note the wrapping ' have been changed to doublequotes as well

See here for more information:

https://support.nagios.com/kb/article/n ... s-580.html

Let us know the results.

Thank you!
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Need help on check_msmq plugin

Post by bsivavani »

Thanks for the update. I am able to resolve this issue after removing PInt variables from script and hardcoded the threshold values.

From
valMaxWarn = CInt(objArgs(2))
valMaxCrit = CInt(objArgs(3))

To
valMaxWarn = 20
valMaxCrit =30

Kindly let us know if there is any way to find out how many messages are received per day ?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Need help on check_msmq plugin

Post by ssax »

That's great to hear!

Unfortunately I was unable to find a plugin that would get you the total messages per day, you would likely need to write one yourself if that information is available.

Let us know if you have any questions.

Thank you
Locked