Jump to content

Recommended Posts

Posted

Can anyone recommend a free tool to monitor if a server (w2k3 and w2k8) has restarted itself following a mains failure and send me an alert via email or SMS?

 

Simon

Posted

That looks like a catch 22 - need a working server to test that another server is up/down :)

 

This is for single server sites - something that is run on startup to signal that an event has happened

 

Simon

Posted (edited)

Look for events 1074/76 (need to check those event IDs are correct) in the system log by running a scheduled task on start up. Think this would be the way to go(although a UPS would not go a miss!) you can eMail or as I would send an SMS (or both).

 

anyhow something like this

 

#Search the system log

$data=Get-EventLog -EntryType Error -LogName System | ?{$_.EventID -eq 1074 -or $_.EventID -eq 1076}

$emailFrom = "[email protected]"

$emailTo = "[email protected]"

$subject = "Events 1074 and 1076"

 

#Could I guess fish out the time of the events and add them to the body of the mail. Using the Get-Eventlog Cmdlet

$body = $data

 

#if this is running at start up and you have no UPS and all your servers go down, I would maybe give your mail server chance to be there!

$smtpServer = "your smtp server"

$smtp = new-object Net.Mail.SmtpClient($smtpServer)

$smtp.Send($emailFrom, $emailTo, $subject, $body

 

PowerShell is your friend here, say that all the time!

Edited by HPlum78
Posted
I never understand why people insist on using third party software to do what is core OS functionality, in W2K8 you can achieve the above by using event viewer and attaching a task to an event, PowerShell is just another way of doing this and is not a bad way to start learning how to use the OS to report on events that happen without installing odd bits of software. Try it you may find that you open up a whole new world and at the end of the day the time you spend installing and learning new bits of software could be used gaining new skills and a better understanding of the OSs you administrate.
Posted
I Agree with the fact that 2k8 can do it our of the box, we use Zabbix for the entire network. We know if theres a network outtage or a fault before a customer/user. We get alerts via SMS and email.
Posted
Right that was not a dig at anyone, more a general gripe. No way of attaching tasks to events in server 2k3 from event viewer, the PS Script should do the same in 2k3 all the way up to 2k12, may need to look a little different if using PS v 1.0 but use the above as a starter for 10.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...