I’m planning to add check_systemd_service plugin to my checks. Copied check_systemd_service file in to /usr/lib64/nagios/plugins on to client machine. I’m using Icinga Agent there, checks defined in ITL are working fine.
The question is how to add/define this check using the director.
Right now I got “Check command ‘check_systemd_service’ does not exist”
critical/config: Error: Validation failed for object ‘client_hostname!systemd_lx’ of type ‘Service’; Attribute ‘command_endpoint’: Command endpoint must be in zone ‘global-templates’ or in a direct child zone thereof.
hello @ritzgu
it’s ok, I figured it out but tell me what is best practice when it comes to configuring lots of systemd services?
How and where to add an argument with the service name. Are you able to provide a screenshot of how it should be configured?
Glad you figured it out. Do you mind sharing what the problem was? In case others have the same problem.
Depends on what you want to check. If you want to check all systemd services for failed units, you could also use the check_systemd plugin which checks all services at once.
If you only want to monitor single services I would use an apply for rule. Here is an example.
Looks like you created a new command check_systemd_service_2. Can you show us the resolved configs for host, service and command (via Object → Preview → Show Resolved)?
What about the command defintions for “check_systemd_service” and “check_systemd_service2” you showed earlier. Which services reference them? I can only see a command defintion for “systemd_service”. (That would explain why the checks can’t find them)
Maybe I can help you out with a possible example how to create the command from scratch:
Command Definition
Command Tab
Arguments Tab (example for the service_name parameter)