Monitoring ubuntu service status
-
-
At some point we will add built-in metric for systemd servicees (https://track.radensolutions.com/issue/NX-2841)
Currently this can be done by configuring ExternalMetric that would call systemctl show SERVICE_NAME --no-pager and pipe it to grep to get the status...
or you can try the new agent functionality that parses xml or json data provided by external commands. It's called external data provider, documented here: https://netxms.org/documentation/adminguide/agent-management.html#externaldataproviderAdd the following to agent configuration file:
### Data provider for systemd service information [ExternalDataProvider/systemdServices] Command = systemctl list-units --type service --full --all --output json --no-pager Description = Data provider for systemctl json outputagent will now have systemdServices() metric that supports jq query as parameter and here's example of metric to get status of cron service:
systemdServices(".[]|select(.unit==""cron.service"")|.active")
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login