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

How to Add Windows Mailqueue Notification

Post by rlinux57 »

Please help me out, how to add windows mail queue notification in nagios.


Note: we're using mailenable for email in windows server.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: How to Add Windows Mailqueue Notification

Post by tgriep »

We need to verify the type of email server you want to monitor and the version it is running.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

We're using mailenable standar version 8.53
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: How to Add Windows Mailqueue Notification

Post by millisa »

According to this mailEnable KB article, mailEnable stores its queues in a directory as two files: one in the base directory containing routing info and one in a Messages subdirectory with the actual content of the mail. (The article gives the default location for the Outgoing queue directory and implies the Incoming directory is similarly located).

It seems to me you could just use a filecounter plugin and trigger based on the count of files in either that main directory or the Messages subdirectory for each queue.

Here is a filecounting script that someone wrote that is intended for use with NRPE on windows:
http://exchange.nagios.org/directory/Pl ... nt/details
They even mention it being used for mail queues as a possible use case.
(I don't use this, but a quick glance at the included wsf file appears to do what they claim).
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: How to Add Windows Mailqueue Notification

Post by tmcdonald »

rlinux57, please let us know if millisa's suggestion works out for you.
Former Nagios employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

thanks for the material, it's really very helpful for me. But i'm stucked.

I've added this line in nsc.ini: alias_directory_file_count = Wscript.exe //T:30 //NoLogo c:\Program Files\NSClient++\scripts\directory_file_count.wsf $ARG1$
And add this line in script: c:\Program Files\NSClient++\scripts\directory_file_count.wsf C:\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages 25 75

And run this command in nagios server: ./check_nrpe -H $Hostname -t 30 -c directory_file_count -a 'C:\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages 25 75'

Getting this error after running above command on nagios server: Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

C: = The disk drive that contains the directory path we're are monitoring.
\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Queues\SMTP\Outgoing\Messages = The directory path we're are monitoring.
25 = The threshold limit for a WARNING message.
75 = The threshold limit for a CRITICAL message.


But cannot get any solution.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: How to Add Windows Mailqueue Notification

Post by sreinhardt »

Looks like arguments are not allowed via nsclient. You should look for the following section and make sure that allow arguments is true:

Code: Select all

[/settings/NRPE/server]
; 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
Restart the nsclient service, and attempt your check again.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

I've added line in nsc.ini as per your direction but still getting same error.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: How to Add Windows Mailqueue Notification

Post by rlinux57 »

Running command on nagios server: /usr/lib64/nagios/plugins/./check_nrpe -H HOSTNAME -t 30 -c alias_directory_file_count

Now getting this error: No handler for command: wscript.exe

I've checked wscript.exe is present at this location "C:\Windows\System32"
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to Add Windows Mailqueue Notification

Post by abrist »

Can you attach/post in code wraps the full nsc.ini?
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.
Locked