This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Monitoring a servers uptime

I am wondering what the best way to monitor a servers uptime is.  The idea is to alert if the server has been up for over 14 days.  This means it has missed 2 scheduled reboots.  Uptime (from Microsoft) can be used to get the details, but I am trying to avoid writing a script to do this.  If an external application is required, I would like to use (in this ideal world) a 1 lined command line.

I am after a servers uptime, not a monitors uptime.  I am using IPMonitor 8.5.

uptime.exe
www.microsoft.com/.../uptime.mspx

Uptime Output
\\<SERVER> has been up for: 2 day(s), 8 hour(s), 47 minute(s), 23 second(s)

 Any Ideas?

  •  I ended up creating an agent in Lotus Notes which checks the server and generates a web page. I then use the a HTTP monitor to for the existence of the work "Alert".


    If anyone is interested in my lotusscript code, let me know.

  •  I need to monitor the uptime of a Domino server too.  I don't necessarily want to get into Notes to get the data every time.  I would like to see your script if you don't mind.

  •  I tried this 2 ways.

    Using Uptime from Microsoft and awk for windows

       uptime | awk '{if ($6 >= 14){print "Alert"}}

    and LotusScript

        Set session = New NotesSession
        arg = session.DocumentContext.Query_String(0)
        p1 = Instr(arg, "=")   
        notesServer = Ucase(Strright( arg, "="))
        serverName$ = notesServer
        consoleCommand$ = "show heartbeat"
        consoleReturn$ = session.SendConsoleCommand(    serverName$, consoleCommand$)
        serverUpTime = Strright(Strleft(consoleReturn$," seconds"),": ")   
        upTime = Cdbl(serverUpTime)/60/60/24   
        roundedUpTime = Cstr(Round(upTime,2))

        If roundedUpTime > 14 Then
            Print "Status: ALERT"
        Else
            Print "Status: OK"
        End If 'roundedUpTime > 14

     

    Thats pretty much it.  I then use a HTTP monitor and search for the word "ALERT".  If it finds ALERT, then the monitor goes into warn and down state.

  • I think there is a way to achieve this without any external code.  I've tested it with IPM9 so it may also work with IPM8.5.

    1. Create a Custom SNMP monitor for the server.
    2. Set the OID to 1.3.6.1.2.1.1.3.0 (seems to do this by default).  This is the SNMPv2 sysUpTime MIB value.
    3. Under Analysis of Test Results, Analyze the Result as Numeric Data, Result is < 120960000 (14 days expressed as hundredths of seconds).

    This is testing the uptime of the SNMP agent on the server, which is normally the same as the server's uptime unless someone has stopped/restarted the SNMP service.  When the value exceeds the threshold, an alert is generated.

    HTH

    Rgds, Simon