bofh80
28 September 2020 23:47
1
I’ve added a Service Template feature.
You create a template, as you would the Service, and apply it to a Device Group.
You can add(apply) the services, remove the services, and edit / change the template.
If you enable discover_services: true it will apply / update templates automatically based on the service discovery frequency.
I would appreciate some feedback and testing.
I’m still waiting for a code review, so expect bugs.
librenms:master
← bofh80:add-service-template
opened 07:16PM - 18 Sep 20 UTC
You create a Service Template and assign it to multiple Devices or Device Group… s.
Services (as specified by the template) will be created for all Devices or Device Groups.
You can do this with the function buttons, or enable the discover_services_templates: true, to have it run and apply on discover intervals.
This is similar to how nagios works.( You assign checks to 'host groups' and then assign devices to host groups)
All code seems to work fine. But please see my comment below about the db schema and index.
Service Templates:
![stv2](https://user-images.githubusercontent.com/796972/97504303-85fd5080-196e-11eb-8df0-5443264d976c.png)
Add / Edit Service Template:
![sted](https://user-images.githubusercontent.com/796972/97504339-944b6c80-196e-11eb-85b8-163c258a5032.png)
Updated Services:
![4srv](https://user-images.githubusercontent.com/796972/94325384-0ad30400-ff96-11ea-8cf5-a247acfcec15.png)
Updated Add Service:
![4srvadd](https://user-images.githubusercontent.com/796972/94325300-c0ea1e00-ff95-11ea-82f7-11df16ff2f83.png)
Updated Edit Service:
![5srvedit](https://user-images.githubusercontent.com/796972/94325364-f4c54380-ff95-11ea-9083-58d56309c1b3.png)
DO NOT DELETE THE UNDERLYING TEXT
#### Please note
> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.
- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)
- [x] If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
#### Testers
If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`. If there are schema changes, you can ask on discord how to revert.
5 Likes
Perfect, this is what we need. Thank you.
awaum
15 February 2021 09:01
3
This sounds great … but I cannot see “Service Templates” anywhere in my WUI…
(Under “Services” I just have “Add Service”…)
Do I have to enable anything in the settings?
Can you give me hint where to find all these pages in the WUI ?
Thank you!
bofh80
15 February 2021 21:39
4
It has been merged to master this month.
It is not in the 21.1.x release.
1 Like