- C# 77.7%
- HTML 13.8%
- Shell 7.9%
- Batchfile 0.6%
| MonitoringAgent | ||
| Scripts | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| MonitoringAgent.sln | ||
| publish.bat | ||
| publish.sh | ||
| README.md | ||
Monitoring Agent
Monitoring Agent is a very simple agent that collects information on CPU usage, memory usage and storage.
The agent exposes a HTML widget.
You can use it to display server status in Homarr
Installation
To install Monitoring Agent in your Linux server as a service:
-
Download the latest binary release for Linux
-
Unzip the archive with the command
unzip v0.1.0-linux-x64.zipConfiguration
Configure your agent and widget by editing the file
appsettings.json-
Set
NameandLogo"Name": "My server", "Logo": "https://mylogo.com/logo.png", -
Set
UsernameandPassword"Auth": { "Username": "<Username>", "Password": "<Password>" }, -
Enable or disable system widgets. By default this widgets are enabled:
"SystemWidgetsEnabled": [ "Uptime", "Public IP", "Process count", "CPU", "Memory" ], -
Add storage.
Namemust be equal to the path or drive to monitor (i.e.C,/mnt/Volume) ."Storages": [ { "Name": "/", "Label": "Root" } ], -
Add sensors. Works only on Linux.
Sensor monitor uses the
sensorscommand. You can check the output of the command to see whichDeviceandSensoryou can read."Sensors": [ { "Device": "coretemp-isa-0000", "Sensor": "Package id 0", "Label": "Package id 0" } ], -
Add hdd temperature. Works only on Linux.
Hdd temperature monitor uses the
hddtempcommand"DisksTemperature": [ { "Device": "/dev/sda", "Label": "sda" } ], -
Set the widget order.
Standard names are:
Uptime,Public IP,Process count,CPUandMemory.For storage use
Storage (Name).For Sensors use
Sensor (Name).For disk temperature use
Disk (Device).To display a separator use
-.You can check the names by opening the json endpoint with your browser.
http://localhost:5000?username=USERNAME&password=PASSWORD
"Widget": [ "Uptime", "Public IP", "Process count", "CPU", "Memory", "-" "Storage (/)" ],
-
-
Copy the program files
cd ./linux-x64 sudo mkdir /opt/monitoringagent sudo cp -r * /opt/monitoringagent/ sudo chmod +x /opt/monitoringagent/MonitoringAgent -
Create the user to run the service
sudo useradd -r -d /opt/monitoringagent -s /usr/sbin/nologin monitoringagent sudo chown -R monitoringagent:monitoringagent /opt/monitoringagent -
Create the service file
sudo tee /etc/systemd/system/monitoringagent.service > /dev/null <<EOF [Unit] Description=Monitoring Agent Documentation=https://git.piblog.org/sakya/MonitoringAgent Wants=network-online.target After=network-online.target [Service] Type=simple User=monitoringagent Group=monitoringagent WorkingDirectory=/opt/monitoringagent Environment="ASPNETCORE_ENVIRONMENT=Production" ExecStart=/opt/monitoringagent/MonitoringAgent TimeoutStopSec=5s LimitNOFILE=1048576 PrivateTmp=true ProtectHome=true ProtectSystem=full AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target EOF -
Enable and start the service
sudo systemctl daemon-reload sudo systemctl enable --now monitoringagent sudo systemctl start monitoringagent
Your agent should be listening on port 5000 at
- http://localhost:5000?username=USERNAME&password=PASSWORD json data
- http://localhost:5000/widget?username=USERNAME&password=PASSWORD the widget
Widget parameters
Parameters accepted by the widget:
username: mandatory.password: mandatory.spinnerEnabled: optional boolean value (trueorfalse) to enable or disable the spinner when che widget is updating its data. By default the spinner is enabled.headerEnabled: optional boolean value (trueorfalse) to enable or disable the header (logo and name). By default the header is enabled.refreshInterval: number of seconds between each data update. The default value is 10 seconds.
Updating
To update Monitoring Agent you can use the update.sh script.
The script downloads the zip file, updates the installed files and restart the service.
