none
Getting low disk space alerts to email me using Server 2008

    Question

  • Hi,

    I had a previous thread last week regarding this subject for Windows Server 2003 here...

    http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/eecb1753-148e-4d1b-a3b0-fd968c2b7c9a/

    ... but obviously I have realized the procedure is quite different for Server 2008 which I am now seeking help with for the same thing, that is, receiving an email when disk space is low.  If I can get some deatiled instructions it would be greatly appreciated.  AT this point, I already have the emailing batch file created, I just need to know how to create the performance monitor to launch that batch in Server 2008.

    Thank you in advance!  This group has been very helpful.


    Dennis Parrish

    Sunday, February 19, 2012 10:15 AM

Answers

All replies

  • Here are the steps.

    Admin Tools|Task Scheduler and create a new task.
    Enter a name for the task
    Select When a specific event is logged

    Next
    Log = System
    Source = Srv
    Event ID = 2013

    Next
    Send an e-mail

    Next
    fill in the form including a valid smtp server

    Next and Finish

    DiskSpaceThreshold
    http://technet.microsoft.com/en-us/library/cc786996(WS.10).aspx

    LowDiskSpaceMinimum
    http://technet.microsoft.com/en-us/library/cc784049(WS.10).aspx

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    • Marked as answer by denparrish Tuesday, February 21, 2012 5:42 AM
    Sunday, February 19, 2012 4:10 PM
  • The problem with this one is that when it runs, it presents a pop-up asking for a username, password, and domain for authenticating to the email server.  So instead, I have it successfully launching a batch file succesfully which emails me, however, it only seems to work whenh I manually click "run" even though the properties on the trigger are explicitly set to repeat the task every 5 minutes indefinitely.  Not that I reall want to use that setting, but I need it to email me at some reasonab le interval and so far it will only do so if I manually click "RUN"


    Dennis Parrish

    Sunday, February 19, 2012 8:16 PM
  • I have also tried this method which seemed very promising at first, but I really need it to launch a batch file which will email me. My batch file works by itself so there is no problem with the batch file.  In the forth from the last screen shot from your link above, it sayd to launch the task "send-alert.cmd" but makes no mention of configuring that task.  I just need it to launch my batch file which works.

    Dennis Parrish

    Sunday, February 19, 2012 8:21 PM
  • The credentials the task runs with needs to have permissions to any resources involved.

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Sunday, February 19, 2012 8:26 PM
  • Dave - thanks so much for your replies !  Please excuse my lack of knowledge.  The task was created by the administrator account and runs under the same.  The administrator account has full permissions to the very simple batch file which emails me.  When I click RUN on the task, I get an email in lass than 2 seconds.  However, I need this to happen maybe twice a day.  So for testing purposes now, I have it set for the task to repeat every 5 minutes.  But the ONLY time I actually receive an email is if I manually click RUN on the task.  I'm not understanding how I can get this to run automatically at the interval of my choice?  Again, I appreciate yours and anyone's help !


    Dennis Parrish

    Sunday, February 19, 2012 8:56 PM
  • "send-alert.cmd" is my script to send email...

    @echo off
    setlocalrem send-alert.cmdrem path to blat.exe
    rem http://www.blat.net/
    set path=c:\admin\bin;%path%
    set filename=%~n0
    set logfile="%TEMP%\_%filename%.txt"
    set appendLOG=^>^> %logfile% 2^>^&1
    
    :::::::::::::: Lets set some variables ::::::::::::::
    set eMail="gastone.canali@ooo.eu"
    set mailTo=gastone.canali@myremote.it
    set subj=-s "Alert: %computername% Disk full ."
    set server=-server 10.10.10.2
    set x=-x "X-Header-Test: Automatic Alert... ciao da Gastone "
    set debug=-debug -log blat.log -timestamp 
    set BODY=-body "Autoamtic Mail  %date% %time%. "
    if exist "%~1" (
         set attach=-attach "%~1" 
    ) else (
         set attach=%body%
    )
        
    ::::::::::::::::: Now we run Blat!  :::::::::::::::::
    blat  "%~1" -to %mailTo% -f %eMail% %subj% %server% %debug% %x% %attach%   %appendLOG%
    


    Gastone Canali >http://www.armadillo.it




    Sunday, February 19, 2012 8:57 PM
  • Thank you for your replies too Gastone.  I also have a very simple email script which works 100% of the time when launched on its own.  So where does your script reside?  When I enter the explicit path to my script, the performance monitor doesn't launch it.

    Dennis Parrish

    Sunday, February 19, 2012 9:01 PM
  • Does "administrator" account have smtp authentication permissions? Also note that the task author and the user account that runs task can be different. Some details below.

    http://technet.microsoft.com/en-us/library/cc721846(v=ws.10).aspx

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Sunday, February 19, 2012 9:09 PM
  • Dave, I am not sure you are understanding my current issue.  The task is sitting there and it works perfectly when I click RUN.  I get the email every single time within 2 seconds.  My issue at this point is that I need the task to run automatically, not just when I manually click RUN. 

    Dennis Parrish

    Sunday, February 19, 2012 9:25 PM
  • That's the part where you need to have set the trigger to on an event, then log=system, source=srv, event id=2013

    Also set as desired

    DiskSpaceThreshold
    http://technet.microsoft.com/en-us/library/cc786996(WS.10).aspx

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Sunday, February 19, 2012 9:35 PM
  • Looking the link above:

    '... please copy the bat file to %windir%\system32 folder. DO NOT use C:\1\emailalert.bat pattern. Just use "emailalert.bat"'

    Copy your file %windir%\system32  and don't specify the path in the "alert task"


    Gastone Canali >http://www.armadillo.it

    Sunday, February 19, 2012 9:36 PM
  • Gastone, you are looking at my original link above from Server 2003.  It was already moved to the System32 directory and that one in 2003 works no problem.  It is in the system32 directory on the Windows 2008 server as well.

    Dennis Parrish

    Sunday, February 19, 2012 10:57 PM
  • Dave, thanks again but I still do not think you are unserstaning the issue.  The trigger settings have already been done.  The theshold has been set.   I click RUN and the trigger functions and I get the email.  The task works.  My problem here is that it only works when I click RUN.  The only thing that is not functioning here is the task running on a set interval such as every hour. 

    Dennis Parrish

    Sunday, February 19, 2012 11:03 PM
  • If you have configured correctly, as Dave explained, the task will run on event bases.

    On an event
    This trigger causes the task to run when specific event entries are added to an event log. You can choose between specifying basic event trigger settings or custom event trigger settings. If you choose the basic event trigger settings, a single event from a specific event log will trigger the task.


    Gastone Canali >http://www.armadillo.it

    Sunday, February 19, 2012 11:20 PM
  • We're going in circles. It should run whenever the system log events of source type SRV and event id of 2013 appear.

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Sunday, February 19, 2012 11:53 PM
  • My apologies Dave, we are going in circles because of me.  I'm embarrassed to say that I thought I had set the DiskSpaceThreshold and LowDiskMinimum to values that would set off the event, but I was obviously wrong by a long shot.  This is just a test server so I just spent the last few hours purposely filling up a 500 Gb drive to the point where there is only 28 Mb left - and guess who received an email?  Right, me! : - )

    The alert emails are coming in every 5 minutes as I'm typing this which is good, that is what I set it to just as a test.

    In my 2003 scenario, I was able to purposely set the threshold high even though I had 470 Gb free. But that setting was not done in the registry and that is where I get confused in 2008.  I consider the issue resolved now, but I could use help on one more thing and that is setting those two parameters in registry - I see the default setting on DiskSpaceThreshold is "10" - is that a decimal or hex setting?

    I would want to know what decimal settings would be entered in both areas (DiskSpaceThreshold and LowDiskMinimum) if for instance, I wanted the event 2013 to trigger when there was only 50 Gb left on a 500 Gb drive. (just as an example)?

    I appeciate all your help and I will be marking your very first reply as the answer when I return home from work today.

    Again, thank you for your patience with me!!


    Dennis Parrish

    Monday, February 20, 2012 1:47 PM
  • No problem, I understand. :-) If the disk size is 500 and you want to trigger at 50 then what you have for setting should be correct as 10%. Also yes, change the base to decimal before setting value.

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Monday, February 20, 2012 2:46 PM
  • Hi Gastone,

    I also wanted to thank you for your help!  It is really appreciated.  I don't know if you saw my last reply to Dave where I realized what my problem was.

    Dennis


    Dennis Parrish

    Tuesday, February 21, 2012 12:19 PM
  • Hi Gastone ,

    thanks a lot for your tips , works really fine ,  I modifyed your cmd  to write the alert in a small database , in order to centralize alerts for several server ,  works great..

    thanks

    Eduardo Trujillo


    Thursday, August 23, 2012 8:25 PM