This is a PowerShell script that you can use with Uptime Kuma's push feature for monitoring servers on a network Uptime Kuma can't communicate with. Example: Your Uptime Kuma server is in the cloud but you want to monitor servers and devices on your local network.
Find out more about Uptime Kuma: https://github.com/louislam/uptime-kuma
{
"settings":{
"push_url": "https://myuptimekuma.host/api/push/{ID}?status={STATUS}&msg={MSG}&ping={PING}",
"loop": false,
"loop_delay": "30",
"push_if_down": true
},
"monitors":[
{"id": "2e7mMkKP873", "type": "ping", "host": "10.0.0.20"},
{"id": "GSgX3MyQ5T7", "group":[
{"type": "website", "host": "https://internal-site.domain.com", "search": "Welcome to our internal home page"},
{"type": "port", "host": "10.0.0.30", "port": 22},
]
}
]
}
The URL is based on the one from the Uptime Kuma monitor settings page (after creation), for most people the only thing that will change from the example URL is the domain. Do NOT remove the {VARIABLES} from the example, they are required for the script to insert data during individual tests.
https://myuptimekuma.host/api/push/{ID}?status={STATUS}&msg={MSG}&ping={PING}
The "loop" setting, if true, will restart the tests forever and use loop_delay (seconds) between each run. If you use this option, you should only configure your scheduled task to run once on startup. Alternatively you can set loop to false and create a scheduled task that repeats once per minute forever.
The setting "push_if_down", if true, will send a notification to Uptime Kuma when a test fails, this is the default and doesn't need to be changed normally. If you set this to false, Uptime Kuma will not get a notification but the heartbeat/retries settings on Uptime Kuma will still determine an issue exists.
The ID from your Uptime Kuma URL is used here, the ID is just after the "/push/" part of the URL. A group of tests use one ID and if any one of those tests fails it will report back to Uptime Kuma as down. Do NOT use same ID multiple times unless you are using "upside down mode" in Uptime Kuma.
The script offers three types of monitor tests:
This is the IP or hostname to test.
The example configuration does not include this option because its optional and isn't well documented yet, you can set this on individual monitors, check the script functions to see what current defaults are.