How to Add Windows Mailqueue Notification

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

abrist wrote:Can you attach/post in code wraps the full nsc.ini?

nsc.ini

# If you want to fill this file with all avalible options run the following command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/modules]

; CheckDisk - CheckDisk can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckDisk = 1

; Event log Checker. - Check for errors and warnings in the event log. This is only supported through NRPE so if you plan to use only NSClient this wont help you at all.
CheckEventLog = 1

; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1

; Helper function - Various helper function to extend other checks. This is also only supported through NRPE.
CheckHelpers = 1

; Check NSCP - Checkes the state of the agent
CheckNSCP = 1

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1

; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1

; NSCAClient - Passive check support over NSCA.
NSCAClient = 1

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1


; Undocumented section
[/settings/default]

; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 167.114.12.220,198.50.248.25

; COMMAND ARGUMENT PROCESSING - This option determines whether or not the we will allow clients to specify arguments to commands that are executed.
allow arguments = true
allow nasty characters = true
port = 5666

; A list of aliases available. An alias is an internal command that has been "wrapped" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]

; alias_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s

; alias_cpu_ex - Alias for alias_cpu_ex. To configure this item add a section called: /settings/external scripts/alias/alias_cpu_ex
alias_cpu_ex = checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s

; alias_disk - Alias for alias_disk. To configure this item add a section called: /settings/external scripts/alias/alias_disk
alias_disk = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED

; alias_disk_loose - Alias for alias_disk_loose. To configure this item add a section called: /settings/external scripts/alias/alias_disk_loose
alias_disk_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable

; alias_event_log - Alias for alias_event_log. To configure this item add a section called: /settings/external scripts/alias/alias_event_log
alias_event_log = CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational') AND source != 'SideBySide'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"

; alias_file_age - Alias for alias_file_age. To configure this item add a section called: /settings/external scripts/alias/alias_file_age
alias_file_age = checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"

; alias_file_size - Alias for alias_file_size. To configure this item add a section called: /settings/external scripts/alias/alias_file_size
alias_file_size = CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10

; alias_mem - Alias for alias_mem. To configure this item add a section called: /settings/external scripts/alias/alias_mem
alias_mem = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page

; alias_process - Alias for alias_process. To configure this item add a section called: /settings/external scripts/alias/alias_process
alias_process = checkProcState "$ARG1$=started"

; alias_process_count - Alias for alias_process_count. To configure this item add a section called: /settings/external scripts/alias/alias_process_count
alias_process_count = checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"

; alias_process_hung - Alias for alias_process_hung. To configure this item add a section called: /settings/external scripts/alias/alias_process_hung
alias_process_hung = checkProcState MaxWarnCount=1 MaxCritCount=1 "$ARG1$=hung"

; alias_process_stopped - Alias for alias_process_stopped. To configure this item add a section called: /settings/external scripts/alias/alias_process_stopped
alias_process_stopped = checkProcState "$ARG1$=stopped"

; alias_sched_all - Alias for alias_sched_all. To configure this item add a section called: /settings/external scripts/alias/alias_sched_all
alias_sched_all = CheckTaskSched "filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0

; alias_sched_long - Alias for alias_sched_long. To configure this item add a section called: /settings/external scripts/alias/alias_sched_long
alias_sched_long = CheckTaskSched "filter=status = 'running' AND most_recent_run_time < -$ARG1$" "syntax=%title% (%most_recent_run_time%)" warn=>0

; alias_sched_task - Alias for alias_sched_task. To configure this item add a section called: /settings/external scripts/alias/alias_sched_task
alias_sched_task = CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title% (%most_recent_run_time%)" warn=>0

; alias_service - Alias for alias_service. To configure this item add a section called: /settings/external scripts/alias/alias_service
alias_service = checkServiceState CheckAll

; alias_service_ex - Alias for alias_service_ex. To configure this item add a section called: /settings/external scripts/alias/alias_service_ex
alias_service_ex = checkServiceState CheckAll "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc

; alias_up - Alias for alias_up. To configure this item add a section called: /settings/external scripts/alias/alias_up
alias_up = checkUpTime MinWarn=1d MinWarn=1h

; alias_updates - Alias for alias_updates. To configure this item add a section called: /settings/external scripts/alias/alias_updates
alias_updates = check_updates -warning 0 -critical 0

; alias_volumes - Alias for alias_volumes. To configure this item add a section called: /settings/external scripts/alias/alias_volumes
alias_volumes = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED

; alias_volumes_loose - Alias for alias_volumes_loose. To configure this item add a section called: /settings/external scripts/alias/alias_volumes_loose
alias_volumes_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED ignore-unreadable

; alias_directory_file_count - Alias for alias_directory_file_count. To configure this item add a section called: /settings/external scripts/alias/alias_directory_file_count
alias_directory_file_count = wscript.exe //T:30 scripts\directory_file_count.wsf $ARG1$


; default - Alias for default. To configure this item add a section called: /settings/external scripts/alias/default
default =
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to Add Windows Mailqueue Notification

Post by Box293 »

NSClient++ includes the ability to check the amount of files that exist in a specific directory, no need for additional scripts:

Example:
Check the amount of files in a folder (and sub-folders). Generate a warning if more that 500 files exist, critical if more than 1000 files exist.

Code: Select all

Command:
check_nrpe -H 192.168.142.1 -t 30 -c CheckFiles -a path='C:\\NO BACKUP' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000

Output:
{12347 Files Found}, found files: 12347 > critical|'found files'=12347;500;1000

I have other file-based check examples for NSClient++ documented here:
http://sites.box293.com/nagios/guides/c ... es-folders
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

I've added the line in nsc.ini but when i run this command,"./check_nrpe -H HOSTNAME -t 30 -c directory_file_count -a path='C:\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000"

i'm getting an error: Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
Last edited by rlinux57 on Sun Jan 04, 2015 11:55 pm, edited 1 time in total.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to Add Windows Mailqueue Notification

Post by Box293 »

You need to allow arguments in NSClient++.

Open a command prompt
Type cd "\Program Files\NSClient++\" and press Enter
Type nscp settings --path /settings/NRPE/server --key "allow arguments" --set true and press Enter
This may prompt you for permission
Type nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true and press Enter
This may prompt you for permission

Then restart the NSClient++ service (Administrative Tools > Services)

Also, you may need to escape your backslashes

Code: Select all

./check_nrpe -H HOSTNAME -t 30 -c CheckFiles -a path='C:\\Program Files (x86)\\Parallels\\Plesk\\Mail Servers\\Mail Enable\\Queues\\SMTP\\Outgoing\\Messages' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

I've already allow these arguements but still getting error.

Here's my directory_file_count: i've added path in this file.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' "directory_file_count.wsf"
'
' 07/11/2003 ver 0.1
'
' Author: Joe Garfunkel - JGarfunkel@saipeople.com
'
' Credits to Ethan Galstad / Hagen Deike for the script
' design of "check_fileage", which I copied and modified.
'
' --------------------------------------------------------------
'
' This script counts the number of files contained within a
' directory path. For example, the number of files contained
' in an email queue directory.
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

<job>
<runtime>
<description>
directory_file_count (nrpe_nt-plugin) 1.1
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

This plugin was developed on Microsoft Windows 2000, using "Windows
Script Host" version 5.6 . The current version of the Script Host
can be downloaded from msdn.microsoft.com/scripting/

This plugin also requires the use of Microsoft "Windows Management
Instrumentation" (WMI), which is included in the default Win2K,
but the "Core WMI" must be installed manually on Windows NT. The
download site for WMI can be found by going to:
http://www.microsoft.com/downloads/rele ... seID=18491

(It seems that Microsoft has hiddent this NT download in the darkest
crevice to make it as difficult as possible to find. Make sure
you download the correct version for NT, and not the '95, '98, ME
version.)

This plugin will count the number of files that are contained within a
specific directory path. For example, the number of files contained in
an mail queue directory.

This version of the "directory_file_count" plugin does not perform
any validation on your command-line options. Please follow the
syntax provided, and double-check that you have typed your
options correctly. -Thanks!

An example execution command to run this plugin from the nrpe.cfg follows.
The command should all be entered on one line, but is wrapped here for
readability.

command[directory_file_count]=c:\Windows\System32\cscript.exe
//NoLogo //T:30
c:\Program Files\NSClient++\scripts\directory_file_count.wsf c:\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages 500 1000

</description>
<named
name="h"
helpstring="Help"
type="simple"
required="false"
/>
<unnamed
name="c"
helpstring="Disk Drive Letter."
many="false"
required="true"
/>
<unnamed
name="directory-path"
helpstring="\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages"
many="false"
required="true"
/>
<unnamed
name="warning-value"
helpstring="25."
many="false"
required="true"
/>
<unnamed
name="critical-value"
helpstring="75."
many="false"
required="true"
/>
<example>
Example: directory_file_count.wsf c: \\Temp\\Queue\\ 5 10
</example>
</runtime>
<script language="cscript">

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

If Wscript.Arguments.Named.Exists("h") Or Wscript.Arguments.Count = 0 Then
Wscript.Echo "Plugin help screen:"
Wscript.Arguments.ShowUsage()
Wscript.Quit(0)
End If

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Const's and Var's
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

strDiskDrive = Wscript.Arguments.Unnamed.Item(0)
strPath = Wscript.Arguments.Unnamed.Item(1)
strWarningValue = Wscript.Arguments.Unnamed.Item(2)
strCriticalValue = Wscript.Arguments.Unnamed.Item(3)

'Wscript.Echo "strDiskDrive: " & strDiskDrive
'Wscript.Echo "strPath: " & strPath
'Wscript.Echo "strWarningValue: " & strWarningValue
'Wscript.Echo "strCriticalValue: " & strCriticalValue

FileCount = 0

Const intOK = 0
Const intWarning = 1
Const intCritical = 2
Const intUnknown = 3

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

strComputer = "."

'Wscript.Echo "Before set objWMIService ."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Wscript.Echo "Before set objWMIService.ExecQuery ."

Set colFiles = objWMIService.ExecQuery _
( "SELECT * FROM CIM_DataFile WHERE Drive = '" & strDiskDrive & "' AND Path = '" & strPath & "' ")


FileCount = 0
For Each objFile in colFiles
'Wscript.Echo objFile.Name
FileCount = FileCount + 1
Next


'Wscript.Echo "Total number of files is: " & FileCount


FileCount = Int(FileCount)
strWarningValue = Int(strWarningValue)
strCriticalValue = Int(strCriticalValue)


If ( FileCount > strWarningValue ) or ( FileCount > strCriticalValue ) Then
'Wscript.Echo "Inside outer If statement."

If (FileCount > strCriticalValue) Then
'Wscript.Echo "Inside CriticalValue If statement."
Wscript.Echo "CRITICAL: File count is " & FileCount & "."
Wscript.Quit(intCritical)
End If


If (FileCount > strWarningValue) Then
'Wscript.Echo "Inside WarningValue If statement."
Wscript.Echo "WARNING: File count is " & FileCount & "."
Wscript.Quit(intWarning)
End If

End If


Wscript.Echo "OK: File count is " & FileCount & "."
Wscript.Quit(intOK)


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

</script>
</job>
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to Add Windows Mailqueue Notification

Post by Box293 »

Did you restart the NSClient service on the windows box.

Please post your current nsc.ini file here
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

Yes i've restart it after change settings.
nsc.ini file:

# If you want to fill this file with all avalible options run the following command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help


; Undocumented section
[/modules]

; CheckDisk - CheckDisk can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckDisk = 1

; Event log Checker. - Check for errors and warnings in the event log. This is only supported through NRPE so if you plan to use only NSClient this wont help you at all.
CheckEventLog = 1

; Check External Scripts - A simple wrapper to run external scripts and batch files.
CheckExternalScripts = 1

; Helper function - Various helper function to extend other checks. This is also only supported through NRPE.
CheckHelpers = 1

; Check NSCP - Checkes the state of the agent
CheckNSCP = 1

; CheckSystem - Various system related checks, such as CPU load, process state, service state memory usage and PDH counters.
CheckSystem = 1

; CheckWMI - CheckWMI can check various file and disk related things. The current version has commands to check Size of hard drives and directories.
CheckWMI = 1

; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1

; NSCAClient - Passive check support over NSCA.
NSCAClient = 1

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1


; Undocumented section
[/settings/default]
; ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = 167.114.12.220,198.50.248.25
port = 5666

nscp settings --path /settings/NRPE/server --key "allow arguments" --set true

nscp settings --path /settings/NRPE/server --key "allow nasty characters" --set true



; 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
;allow_nasty_meta_chars=1


; A list of aliases available. An alias is an internal command that has been "wrapped" (to add arguments). Be careful so you don't create loops (ie check_loop=check_a, check_a=check_loop)
[/settings/external scripts/alias]

; alias_cpu - Alias for alias_cpu. To configure this item add a section called: /settings/external scripts/alias/alias_cpu
alias_cpu = checkCPU warn=80 crit=90 time=5m time=1m time=30s

; alias_cpu_ex - Alias for alias_cpu_ex. To configure this item add a section called: /settings/external scripts/alias/alias_cpu_ex
alias_cpu_ex = checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s

; alias_disk - Alias for alias_disk. To configure this item add a section called: /settings/external scripts/alias/alias_disk
alias_disk = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED

; alias_disk_loose - Alias for alias_disk_loose. To configure this item add a section called: /settings/external scripts/alias/alias_disk_loose
alias_disk_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ignore-unreadable

; alias_event_log - Alias for alias_event_log. To configure this item add a section called: /settings/external scripts/alias/alias_event_log
alias_event_log = CheckEventLog file=application file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -2d AND severity NOT IN ('success', 'informational') AND source != 'SideBySide'" truncate=800 unique descriptions "syntax=%severity%: %source%: %message% (%count%)"

; alias_file_age - Alias for alias_file_age. To configure this item add a section called: /settings/external scripts/alias/alias_file_age
alias_file_age = checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"

; alias_file_size - Alias for alias_file_size. To configure this item add a section called: /settings/external scripts/alias/alias_file_size
alias_file_size = CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10

; alias_mem - Alias for alias_mem. To configure this item add a section called: /settings/external scripts/alias/alias_mem
alias_mem = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page

; alias_process - Alias for alias_process. To configure this item add a section called: /settings/external scripts/alias/alias_process
alias_process = checkProcState "$ARG1$=started"

; alias_process_count - Alias for alias_process_count. To configure this item add a section called: /settings/external scripts/alias/alias_process_count
alias_process_count = checkProcState MaxWarnCount=$ARG2$ MaxCritCount=$ARG3$ "$ARG1$=started"

; alias_process_hung - Alias for alias_process_hung. To configure this item add a section called: /settings/external scripts/alias/alias_process_hung
alias_process_hung = checkProcState MaxWarnCount=1 MaxCritCount=1 "$ARG1$=hung"

; alias_process_stopped - Alias for alias_process_stopped. To configure this item add a section called: /settings/external scripts/alias/alias_process_stopped
alias_process_stopped = checkProcState "$ARG1$=stopped"

; alias_sched_all - Alias for alias_sched_all. To configure this item add a section called: /settings/external scripts/alias/alias_sched_all
alias_sched_all = CheckTaskSched "filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0

; alias_sched_long - Alias for alias_sched_long. To configure this item add a section called: /settings/external scripts/alias/alias_sched_long
alias_sched_long = CheckTaskSched "filter=status = 'running' AND most_recent_run_time < -$ARG1$" "syntax=%title% (%most_recent_run_time%)" warn=>0

; alias_sched_task - Alias for alias_sched_task. To configure this item add a section called: /settings/external scripts/alias/alias_sched_task
alias_sched_task = CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title% (%most_recent_run_time%)" warn=>0

; alias_service - Alias for alias_service. To configure this item add a section called: /settings/external scripts/alias/alias_service
alias_service = checkServiceState CheckAll

; alias_service_ex - Alias for alias_service_ex. To configure this item add a section called: /settings/external scripts/alias/alias_service_ex
alias_service_ex = checkServiceState CheckAll "exclude=Net Driver HPZ12" "exclude=Pml Driver HPZ12" exclude=stisvc

; alias_up - Alias for alias_up. To configure this item add a section called: /settings/external scripts/alias/alias_up
alias_up = checkUpTime MinWarn=1d MinWarn=1h

; alias_updates - Alias for alias_updates. To configure this item add a section called: /settings/external scripts/alias/alias_updates
alias_updates = check_updates -warning 0 -critical 0

; alias_volumes - Alias for alias_volumes. To configure this item add a section called: /settings/external scripts/alias/alias_volumes
alias_volumes = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED

; alias_volumes_loose - Alias for alias_volumes_loose. To configure this item add a section called: /settings/external scripts/alias/alias_volumes_loose
alias_volumes_loose = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll=volumes FilterType=FIXED ignore-unreadable

; alias_directory_file_count - Alias for alias_directory_file_count. To configure this item add a section called: /settings/external scripts/alias/alias_directory_file_count
; alias_directory_file_count = cscript.exe //T:30 scripts\directory_file_count.wsf $ARG1$

./check_nrpe -H 142.4.215.171 -t 30 -c directory_file_count -a path='C:\\Program Files (x86)\\Parallels\\Plesk\\Mail Servers\\Mail Enable\\Queues\\SMTP\\Outgoing\\Messages' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000
; default - Alias for default. To configure this item add a section called: /settings/external scripts/alias/default
default =
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to Add Windows Mailqueue Notification

Post by Box293 »

Looking at the ini file I think there is a little confusion with versions and the ini file being used.

In your NSClient++ directory, do you have:
NSClient++.exe
OR
nscp.exe

Also, in your NSClient++ directory, do you have a file called boot.ini? If so can you post it here.

Finally, from your Nagios host execute the following:

Code: Select all

/usr/local/nagios/check_nrpe -H 142.4.215.171
And post the output here (I assume 142.4.215.171 is the IP address of your windows server).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

Windows client NSClient++ file name nsclient.ini


boot.ini file contains below lines:
[settings]
1=ini://${exe-path}/nsclient.ini
[main]
write=ini://${exe-path}/nsclient.ini

=====================================================
/usr/lib64/nagios/plugins/check_nrpe -H 142.4.215.171
output:
I (0,4,1,73 2012-12-17) seem to be doing fine...
=====================================================
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: How to Add Windows Mailqueue Notification

Post by Box293 »

Replace your old ini file with this one:
nsclient.ini
(6.1 KiB) Downloaded 436 times
From your nagios host run this command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 142.4.215.171 -t 30 -c CheckFiles -a path='C:\\Program Files (x86)\\Parallels\\Plesk\\Mail Servers\\Mail Enable\\Queues\\SMTP\\Outgoing\\Messages' pattern=*.* 'master-syntax={%total% Files Found}' MaxWarn=500 MaxCrit=1000
Does this work now?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked