Link to home
Start Free TrialLog in
Avatar of howei
howei

asked on

Utility that counts network device reboots

I need an utility which would show exactly how many times a faulty machine has rebooted during the day time. Kind a ping with recording feature.

Is there anything that would do this that is low cost or free?
Avatar of jabiii
jabiii
Flag of United States of America image

You should just look at the event logs of the PC.
Or if it's a network device have the reboot notices emailed to you....
what type of device?
Avatar of Intense_Angel
Intense_Angel

You can do this with a script.  And it is free.
if the machine running winxp or 2000 you can check  that under Event Viewer >> system
if it is a linux machine you can check system log file  under /var/log
Avatar of howei

ASKER

Nope. This is firewall and I am pinging it but need to know the daily reboot count.

Angel
What kind a script would do this?
What type of firewall? Most already retain this information in their logs....
Or the ability to tell you via email or other if rebooted.
A vbscript....I will help you with it shortly.
Avatar of howei

ASKER

Sonicwall.

It is logging too much information and sending to the email account.
I just need a simple daily count of reboot events.
Angel
you can filter only the lines that have info about the reboot and sent it to you or save it somewhere else where you can read it.  very simple script can do that for you if you have it configured to save the log file.
you need to provide what kind of OS and the format for the log file to let other people help you. if not saved what kind of firewall, cicso pix for example. so be specific

hope this helps!
Here is a script that I just finished up for you.  Copy the code into a text file and rename it to pings.vbs.  To edit the script right click on it and edit.  You will need to do this for each device you want to monitor, because you need to put the ip address of the device your pinging into the script.  For each device you monitor the script will need to be placed in its on folder, it then writes continue to write to a file it will create called pings.txt.  Also....I did not add timing to the script...we can if you want, but you can just run it at certain times from your scheduler.


Here is the code.....

Option Explicit
'*
Const cVBS = "pings.vbs"
Const cTMP = "pings.tmp"
Const cTXT = "pings.txt"
Const cDOM = "150.202.72.43"
Const cIF1 = "Request timed out"
'*
Dim strOTF
strOTF = ""
Dim strRUN
strRUN = "%comspec% /c ping " & cDOM & " > " & cTMP
'*
Dim objWSH
Set objWSH = CreateObject("Wscript.Shell")
objWSH.Run strRUN, 0, true
Set objWSH = Nothing
'*
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call Got()
If strOTF <> "" Then Call Put()
Set objFSO = Nothing

Sub Got()
Dim objOT1
Set objOT1 = objFSO.OpenTextFile(cTMP,1)
strOTF = objOT1.ReadAll
If InStr(strOTF,cIF1) = 0 Then strOTF = ""
Set objOT1 = Nothing
objFSO.DeleteFile cTMP
End Sub

Sub Put()
Dim objOT2
Set objOT2 = objFSO.OpenTextFile(cTXT,8,True)
objOT2.WriteLine(Now() & " : " & strOTF)
Set objOT2 = Nothing
End Sub

ASKER CERTIFIED SOLUTION
Avatar of jabiii
jabiii
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of howei

ASKER

Angel
I did like you said. Copied to Desktop, put in the folder, put the ping destionation IP in the script, double click on it but I don't see much happening neither the text file is created?
First of all, a faulty firewall rebooting several times a day should only be used as a door stopper.

Now, if it has SNMP configured, you may ask the boot time (uptime) and with a small script, you may get the time of boot (actual time minus uptime) and compare it with last uptime recorded to check if it has booted during the period and keep counting and reset the counter every day and send an email at midnight with the number of reboots during the last day.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of The--Captain
Ping is not a tool for determining reboots.  Ping may fail due to a wide variety of conditions, one of which may be a device reset/reboot.

If your device supports SNMP, that would be a much more preferable tool to determine when your device is rebooting (and it can give you tons of additional info as well).

Do not use ping for this, unless you have absolutely no other options.

Cheers,
-Jon



being the FW already logs this event I would just filter the logs for it..... would save you time/effort.
you could even have a script than ran against your logs pulling that info out and dumping it to a file....so you only had to check that file..
I agree with catoaguilar and Th--Captain

SNMP was designed to do exactly what you want.

We use SolarWinds Orion to do this - it monitors key devices and reports on utilization, reboots, etc.  It can also report on other things which an SNMP MIB may monitor - such as memory, disk, and processor utilization, interface throughput utilization, link up/down, high ping response times, etc.

SolarWinds makes a smaller portion of this capability which is client based instead of server based.

Orion:  http://www.solarwinds.net/Orion/Index.htm
Network Performance Monitor:  http://www.solarwinds.net/Tools/Network_Monitoring/Network_Perf_Monitor/index.htm
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of howei

ASKER

A lots of good info here guys. Great bunch!

Angel
I am not sure if this script is workin. Should it show in Task Manager?

SNMP
I have no experince messing with it. It sounds good. Have no money for Solar Winds now...
It is a very brief test and you most likely won't catch it in task manager.

The only way to verify it is working for you is..... put the script named pings.vbs in a folder all by itself, double click it and you will see a pings.tmp file created then deleted.  If it could get a response back then you will get nothing else....if it did not get a response back you will see a file created pings.txt, open that and it will give time and date of no response.

If you want to make sure it is creating the text file you need to put an ip address in the script that is bogus..like 197.34.78.5...run it and you will see the text file created.  

If you enter the script in the task scheduler to run however often everytime it cannot get a response back from your target it will add an additional line to your text file....pings.txt.
>SNMP
>I have no experince messing with it. It sounds good.

We can get more specific if you can provide more details about your equipment.

You don't need SolarWinds to handle SNMP (it just makes it easier).

Cheers,
-Jon
There are "free" tools to monitor networks which run on Linux.  They also rely on SNMP.