Announcement

Collapse
No announcement yet.

WatchDog and HS2 pro as service

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WatchDog and HS2 pro as service

    I have set up the WatchDog script as prescribed, but receive the following error message in the HS2 log:
    Code:
    [COLOR=#ff0000]Scripting runtime error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --- System.InvalidOperationException: Instance 'Homeseer' does not exist in the specified Category. at System.Diagnostics.CounterDefinitionSample.GetInstanceValue(String instanceName) at System.Diagnostics.PerformanceCounter.NextSample() at System.Diagnostics.PerformanceCounter.NextValue() at scriptcode1.scriptcode1.main(String Mode) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)[/COLOR]
    I am running HS2 pro as a service on a XP computer.
    The HS2 service name is HomeSeerService.exe.
    Is this the problem, or is there anything else I could check?

    Thanks! :-)

    #2
    You shouldn't need a watch dog script if you have HS Pro as it has HSSentry included that ensures that HomeSeer is running.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      aeklo,

      From the error I assume you are running my performance monitor graphs? If so, it should automatically detect if you are running it as a service.

      From a temporary event, can you please run the following script statement and let me know what is shown in the Homeseer log:

      &hs.writelog "Service test",hs.RunningAsService()
      Jon

      Comment


        #4
        Originally posted by Rupp View Post
        You shouldn't need a watch dog script if you have HS Pro as it has HSSentry included that ensures that HomeSeer is running.
        I was looking for the CPU usage monitoring feature of Jon00's WatchDog, and running that script as a double protection in addition to HS2Sentry.

        /aeklo

        Comment


          #5
          Originally posted by jon00 View Post
          aeklo,

          From the error I assume you are running my performance monitor graphs? If so, it should automatically detect if you are running it as a service.

          From a temporary event, can you please run the following script statement and let me know what is shown in the Homeseer log:

          &hs.writelog "Service test",hs.RunningAsService()
          Actually, I'm not running your performance monitoring graphs.
          The service test yielded the following results:
          13.05.2012 21:06:22 System Control Panel Immediate Script: &hs.writelog "Service test",hs.RunningAsService()
          13.05.2012 21:06:22 Service test Sann

          Where "Sann" equals "True" on my native language.

          /aeklo

          Comment


            #6
            It is such a long time since I wrote this, that I had forgotten about the processor usage.

            Try the attached replacement script.
            Attached Files
            Jon

            Comment


              #7
              Originally posted by jon00 View Post
              It is such a long time since I wrote this, that I had forgotten about the processor usage.

              Try the attached replacement script.
              Yep, the script now runs, and executes the PSShutdown.exe process.
              But the virtual device for monitoring the CPU load is not created.
              I have set it to be enabled, and a free house code and device number in the .ini.
              Oh, well, the virtual device is actually no big deal, if there isn't an obvious reason
              Thanks for making your superb scripts available to the public!

              /aeklo

              Comment


                #8
                Did you set ShowVirtualDevice=1 in the ini file?
                Jon

                Comment


                  #9
                  Originally posted by jon00 View Post
                  Did you set ShowVirtualDevice=1 in the ini file?
                  Yes, this is my complete ini:

                  [Settings]
                  Startdelay=120
                  CPUTrigger=50
                  ShowPSShutdown=0
                  CPUCheckTime=80
                  PSShutdownTimeEvent=300
                  PSShutdownTimeHighCPU=900
                  ForceShutdown=1
                  HSLogging=1
                  CPULogging=0
                  ShowVirtualDevice=1
                  HL=V
                  HN=8

                  [Data]
                  LastCPUAverage=2
                  LastRunDateTime=09/09/2006 10:13:35
                  CPUCount=0

                  Comment


                    #10
                    I really need to look at this. The last time I worked on this was 2006!

                    Have you added the entries in the startup.txt and shutdown.txt and then restarted Homeseer?

                    The docs should now state the following entry for startup.txt:

                    hs.runex "Jon00WatchDog.vben","main","0"
                    hs.EnableEvent "WatchDog"

                    For shutdown.txt it should now read:

                    hs.DisableEvent "WatchDog"
                    hs.runex "Jon00WatchDog.vben","main","1"
                    Jon

                    Comment


                      #11
                      Yes, I have.
                      But really, Jon, don't bother spending any more time on this for my sake!
                      The primary function I was after is working now, and I'm happy

                      /aeklo

                      Comment

                      Working...
                      X