Announcement

Collapse
No announcement yet.

Monitoring client script/plugin

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

    Monitoring client script/plugin

    Does anyone have a script/plugin that outputs the memory usage /system load etc for a linux client? The client has Homeseer installed.
    The output can be in a the homeseer log or in a device.

    I've found one that monitors cpu temperature but I was wondering if there is an extended script.

    #2
    Here is an old RPi monitoring utility. I have not used it in along time and installed it tonight on my Lightning sensor RPi.

    I think you can tweak it to monitor mono processes.

    Looks like this:

    [ATTACH]63841[/ATTACH]

    Installation:

    1 - sudo wget hxxp://goo.gl/vewCLL -O /etc/apt/sources.list.d/rpimonitor.list *
    2 - sudo apt-get install apt-transport-https ca-certificates dirmngr
    3 - sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
    4 - sudo apt-get update
    5 - sudo apt-get install rpimonitor
    6 - sudo /etc/init.d/rpimonitor update

    Once RPi-Monitor is configured as you wished, browse hxxp://RPiIpAddress:8888/ to access to the web interface.*

    * xx=tt
    Last edited by Pete; October 11, 2017, 12:25 AM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #3
      Thanks Pete for your suggestion. It looks very advanced but I was looking for something that was a bit more integrated in Homeseer self.

      Comment


        #4
        So I took bits and parts from several scripts on this forum and made a script that request the following values:
        - Average CPU load of last 5 minutes
        - Free memory
        - Disk utilatisation

        I scheduled the script to run every 5 minutes.


        Code:
        Imports System.Diagnostics
        
        Sub Main(parm as object)
            Try
                Dim df,free As New ProcessStartInfo()
        
                df.FileName = "/bin/bash"
                df.Arguments = "-c ""df -h | grep /dev/sda1"""
                df.RedirectStandardOutput = True
                df.RedirectStandardError = True
                df.CreateNoWindow = False
                df.WindowStyle = ProcessWindowStyle.Hidden
                df.UseShellExecute = False
        
                free.FileName = "/bin/bash"
                free.Arguments = "-c ""free -m | grep Mem"""
                free.RedirectStandardOutput = True
                free.RedirectStandardError = True
                free.CreateNoWindow = False
                free.WindowStyle = ProcessWindowStyle.Hidden
                free.UseShellExecute = False
        
                Dim dfprocess As Process = Process.Start(df)
                Dim dfoutput As String = dfprocess.StandardOutput.ReadToEnd()
                dfoutput = dfoutput.Split(" ".ToCharArray)(13) 
                dfoutput = dfoutput.Replace("%", "")
                dfprocess.WaitForExit()
        
                Dim freeprocess As Process = Process.Start(free)
                Dim freeoutput As String = freeprocess.StandardOutput.ReadToEnd()
                freeoutput = freeoutput.Split(" ".ToCharArray)(27) 
                freeprocess.WaitForExit()
        
                Dim getload As String = "/proc/loadavg"
                Dim loadstr As String = My.Computer.FileSystem.ReadAllText(getload)
                loadstr = loadstr.Split(" ".ToCharArray)(2)
                Dim load As Double = (Convert.toDouble(loadstr) * 100)
        
                hs.SetDeviceValueByRef(1678, dfoutput, True)'
                hs.SetDeviceValueByRef(1679, freeoutput, True)'
                hs.SetDeviceValueByRef(1680, load, True)
        
            Catch ex As Exception
                hs.WriteLog("", ex.Message)
            End Try
        
        End Sub

        Comment

        Working...
        X