Low Disk Space Alert Sending E-mail Windows 2003 Server PerfMon Alert

I am trying to set up an alert to inform me via email (SMTP) when the free space on one of my servers is less than a specified value. For this I use PerfMon warnings as described on MSFT Technet . I have a warning that works and is written to the syslog, but when I try to set it to Start Program, it fails. The log warning fires, but the program doesn't work.

The program I am using is a small C # application that I wrote to send an smtp message. I have tested the application independently of this server by manually starting it and it works fine without any user interaction (console application). But when I run it through the alert trigger, it fails.

Thanks, Bryan

+1


source to share


2 answers


Maybe you don't have command line arguments for your program? I found the following at http://support.microsoft.com/kb/324752/en-us

When a warning occurs, the service creates a process and starts the specified batch file. The service also copies any command line arguments you specify on the command line that is used to run the file. Click on Command Line Arguments and then select the appropriate check boxes to include the arguments you want when the program is running.

Note. You must choose at least one command line argument or the program will not work. (This is true regardless of the program you choose.)

Do you have any kind of exception handling / logging in your C # application? Are you getting anything from him?



Could you put your C # application call in a batch file and run it from an alert? If you add something like

echo %date% %time% > log.txt

      

at the beginning of your batch file, you can see if it started at all.

+1


source


Have you set the Run As field in the alert properties? If not, your program runs as LocalService, which has no network access (by the way).



Try to set it up for a user account under which you can verify that your program is working correctly.

+1


source







All Articles