Hello,
I am trying to figure out how Service Templates are supposed to work. I am running 22.11.0 in a docker container from docker hub. I have added the following to the config:
$config['discover_services'] = true;
$config['discover_service_templates'] = true;
$config['show_services'] = 1;
$config['nagios_plugins'] = '/usr/lib/monitoring-plugins/';
And I also added the following job to the ‘librenms’ user crontab:
*/5 * * * * /opt/librenms/services-wrapper.py 1
Individual service checks for individual hosts seem to be working. I can set those up in the UI and they seem to work fine. But even after reading the docs and scouring Google, I am very unclear on how Service Templates are supposed to work.
Let’s say I have a set of web hosts (in a device group called “Web Hosts”) already in LibreNMS and want to run the HTTP check against them. Inside the LibreNMS container, I can run this:
/usr/lib/monitoring-plugins/check_http -H arbenesxi1.tb.example.net -S
When defining a single service check, I understand that the check has to be bound to a device in LibreNMS’ inventory, even when that doesn’t really make sense, so I have added a “localhost” device for this purpose. The host I actually want to check is specified in the “Remote Host” field.
How do I translate that to a Service Template that runs check_http against all hosts in the Web Hosts group?
Thanks,
Charles