On Linux that’s not so difficult to do with a Nagios plugin.
I’ve written the script below that will use ssh to login to a machine and issue the “systemctl is-active” command followed by the name of the service you want to check.
I’m a total noob at bash scripting so the code might be crappy, but for me it works 
#!/bin/bash
# Author: JP
# Check if service is running on remote machine using systemd
# Nagios exit codes
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=3
# Arguments
HOSTNAME=$2
USERNAME=$3
PASSWD=$4
SERVICE=$5
if [[ -z $HOSTNAME ]];
then
echo "Hostname is required"
exit $CRITICAL
fi
if [[ -z $USERNAME ]];
then
echo "Username is required"
exit $CRITICAL
fi
if [[ -z $PASSWD ]];
then
echo "Password is required"
exit $CRITICAL
fi
if [[ -z $SERVICE ]];
then
echo "Service is required"
exit $CRITICAL
fi
# Check if sshpass is installed, if not then exit with error message
command -v sshpass >/dev/null || { echo "Dependency sshpass not installed on the LibreNMS server"; exit $CRITICAL; }
sshpass -p "$PASSWD" ssh -T -q -o StrictHostKeyChecking=no -o ConnectTimeout=10 [email protected]$HOSTNAME "systemctl is-active $SERVICE" > /dev/null
exitstatus=$?
if [[ $exitstatus -eq 0 ]];
then
echo "OK: Service $SERVICE is running."
exit $OK
else
echo "CRITICAL: Service $SERVICE is not running!"
exit $CRITICAL
fi
As you can see in the code it is required to have “sshpass” installed on your LibreNMS machine.
I have saved the script as “check_service” in the appropriate nagios plugin directory.
Then add the service to the host you’re monitoring with the username / password / service as the parameters.
PS. In the example I’m checking the “Chrony” service.
Don’t ask me how you can do this on a windows machine though, I don’t know anything about windows 