4 Replies Latest reply on Jul 9, 2008 6:04 PM by simonpt

    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 Output
      \\<SERVER> has been up for: 2 day(s), 8 hour(s), 47 minute(s), 23 second(s)

       Any Ideas?

        • Re: Monitoring a servers uptime

           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.

          1 of 1 people found this helpful
            • Re: Monitoring a servers uptime

               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.

                • Re: Monitoring a servers uptime

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

              • Re: Monitoring a servers uptime

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


                Rgds, Simon