Jump to content

Recommended Posts

  • 1 month later...
Posted

Doesnt seem to work for me I get

 

Line:2

Char: 38

Error: Expected Identifier

 

Dim logon, fndconeN, fndctwo, fnexchange
Dim filesys, objshell, servermessage,

Set filesys = CreateObject("Scripting.FileSystemObject")
Set objshell = CreateObject("WScript.Shell")

fndconeN = "OFF"
fndctwo = "OFF"
fnexchange = "OFF"

If filesys.FileExists ("\\itnm\c$\WINDOWS\win.ini") Then fndconeN = "ON"
If filesys.FileExists ("\\rgbackup\c$\WINDOWS\win.ini") Then fndctwo = "ON"
If filesys.FileExists ("\\rgmail2\c$\WINDOWS\win.ini") Then fnexchange = "ON"

servermessage = "itnm	= " & fndconeN & VBCR & "rgbackup		= " & fndctwo & VBCR &"rgmail2	= " & fnexchange

retval = objShell.Popup(servermessage, ,"Server Status",0 + 64 )

wscript.quit

 

EDIT: Ok fixed it by removing the comma at the end of the second line, cool script ;)

Posted

or you could use uptime.exe

 

uptime.exe \\daedalus

\\daedalus has been up for: 179 day(s), 0 hour(s), 45 minute(s), 59 second(s)

 

You can just run it as a batch if you want and pipe the text to a file.

 

179 days isn't bad for windows servers :p, even then the last power down was due an extended powercut. Means I have some patches to catch up with though!

Posted
Yeah there are already a number of ways to do this. I've used nagios in the past as it'll check individual services on the server too and then e-mail you if something dies. Good stuff. I've used poweradmin in the past too but that's for windows boxen.

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...