Page 3 of 4

Re: How monitor MSMQ

Posted: Tue May 17, 2016 10:21 am
by azam101
what do you mean?

it is already uncommented

if you mean try the below then I have already done this and it was the same:

;# COMMAND ARGUMENT PROCESSING
; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.
allow_arguments=0

Re: How monitor MSMQ

Posted: Tue May 17, 2016 11:17 am
by rkennedy
No, it's not.

Re: How monitor MSMQ

Posted: Tue May 17, 2016 12:06 pm
by azam101
Hi,

I have made the changes but still same issue, see the current on config file.

I have also attached the current log file

Re: How monitor MSMQ

Posted: Tue May 17, 2016 3:20 pm
by rkennedy
What version of NSClient++ are you running? The configuration file looks a bit different -

Mine -

Code: Select all

[/settings/external scripts]
;check_ms_win_disk_load = cmd /c echo scripts\powershell\check_ms_win_disk_load.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -command -
;topcpu = powershell.exe scripts\powershell\topcpu.ps1

; COMMAND TIMEOUT - The maximum time in seconds that a command can execute. (if more then this execution will be aborted). NOTICE this only affects external commands not internal ones.
timeout = 60

; COMMAND ALLOW NASTY META CHARS - This option determines whether or not the we will allow clients to specify nasty (as in |`&><'"\[]{}) characters in arguments.
allow nasty characters = 1

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = 1
Yours -

Code: Select all

[NRPE]
;# NRPE PORT NUMBER
;  This is the port the NRPEListener.dll will listen to.
;port=5666
;
;# COMMAND TIMEOUT
;  This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
;  This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.
allow_arguments=0
Just wondering with the differences there as your formatting isn't the same.

One thing I noticed - you'll need to change allow_arguments=0 to allow_arguments=1 - even though they are uncommented, 0 means no, and 1 means yes. Change this in all applicable places and try once again.

Re: How monitor MSMQ

Posted: Wed May 18, 2016 3:39 am
by azam101
NsClient++ version 0.3.9.328

I have uncommented the below:

CheckExternalScripts.dll
NRPEClient.dll

In the allowed Hosts I have entered the nagios server ip address

allow_arguments are all set to 1
and also allow_nasty_meta_chars all set to 1

I have also uncommented:
Check_vbs_sample and Check_powershell_warn in the External Scripts

ini file and log file attached

Now im getting the error :

2016-05-18 09:42:42: message:NSClient++.cpp:1195: No handler for command: 'ommand'
2016-05-18 09:42:42: message:include\NSCHelper.cpp:238: No handler for command 'ommand'.
2016-05-18 09:42:45: message:NSClient++.cpp:1195: No handler for command: 'ommand'
2016-05-18 09:42:45: message:include\NSCHelper.cpp:238: No handler for command 'ommand'.

Re: How monitor MSMQ

Posted: Wed May 18, 2016 3:59 pm
by tgriep
The nsc.ini file looks like is should work. The errors in the nsclient.log file could be caused by a mis-configured check on the XI server.
Can you post the service config from the XI server so we can review it?

Re: How monitor MSMQ

Posted: Thu May 19, 2016 4:10 am
by azam101
Where is the service config file located? and how can I export it from the nagios xi server?

Re: How monitor MSMQ

Posted: Thu May 19, 2016 9:33 am
by rkennedy
Navigate to Home -> Configure -> Core Config Manager -> Click 'Services' on the left -> Find the service that's failing, then click the floppy disk icon (View Text Config) and paste that output here.

Re: How monitor MSMQ

Posted: Thu May 19, 2016 10:21 am
by azam101

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date:	      2016-05-19 16:32:46
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	host_name			jus2k8app02
	service_description		CPU Usage
	use				xiwizard_windowsserver_nsclient_service
	check_command			check_xi_service_nsclient!Killerd0g!CPULOAD!-l 5,80,90
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			windowsserver
	register			1
	}	

define service {
	host_name			jus2k8app02
	service_description		Drive C: Disk Usage
	use				xiwizard_windowsserver_nsclient_service
	check_command			check_xi_service_nsclient!Killerd0g!USEDDISKSPACE!-l C -w 80 -c 95
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			windowsserver
	register			1
	}	

define service {
	host_name			jus2k8app02
	service_description		Memory Usage
	use				xiwizard_windowsserver_nsclient_service
	check_command			check_xi_service_nsclient!Killerd0g!MEMUSE!-w 80 -c 90
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			windowsserver
	register			1
	}	

define service {
	host_name			jus2k8app02
	service_description		MSMQ MessageCount
	check_command			check_msmq!MessageCount DIRECT=OS:jus2k8app02\private$\CRMHistory_2 100 200!!!!!!!
	max_check_attempts		2
	check_interval			1
	retry_interval			1
	check_period			24x7
	notification_interval		60
	notification_options		w,c,u,r,f,s,
	notifications_enabled		1
	contacts			nagiosadmin
	register			1
	}	

define service {
	host_name			jus2k8app02
	service_description		Ping
	use				xiwizard_windowsserver_ping_service
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			windowsserver
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

Re: How monitor MSMQ

Posted: Thu May 19, 2016 5:02 pm
by ssax
I'm pretty sure it's the $ in your command, in XI put single quotes around your $ARG1$ on the service:

Code: Select all

'MessageCount DIRECT=OS:jus2k8app02\private$\CRMHistory_2 100 200'
Let us know the results.