Hi,
I would like to ask you if it is possible to receive the list of mysql tables / views to be able to extrapolate the following data.
I need to create a list of hosts / services by querying the template hosts and template services.
The goal is to figure out how many hosts / services depend on a particular template object.
I would also like to insert the description during the select.
Best regards,
-Fede
extract info template
Re: extract info template
Hello @Support_Talea
Thanks for reaching out. Could you provide an example of the sorting that you are striving to accomplish with template objects? If you want you can use the web ui or '/usr/local/nagios/etc/...cfg's.
Thanks,
Perry
Thanks for reaching out. Could you provide an example of the sorting that you are striving to accomplish with template objects? If you want you can use the web ui or '/usr/local/nagios/etc/...cfg's.
Thanks,
Perry
-
Support_Talea
- Posts: 73
- Joined: Wed Oct 04, 2017 7:12 am
Re: extract info template
Hi Perry,
I would like to extrapolate this data from the dashboard through a select.
I would like to associate service with servicetemplate and hosts
I would like to associate hosts with hosttemplate and services.
Regards,
-Fede
I would like to extrapolate this data from the dashboard through a select.
I would like to associate service with servicetemplate and hosts
I would like to associate hosts with hosttemplate and services.
Regards,
-Fede
You do not have the required permissions to view the files attached to this post.
Re: extract info template
Hello @Support_Talea
A simple method of pulling from the CCM configs:
Get a list from the host and service templates:
And the host templates:
For example, grep 'local-service' to get a list of service_descriptions:
Then loop the 'hostservicenames.txt' and 'servicenames.txt' would look something like this:
The option to | to 'wc -l' for the count
Others on the community forum might have a better workaround so please let us know.
Thanks,
Perry
A simple method of pulling from the CCM configs:
Get a list from the host and service templates:
Code: Select all
cat /usr/local/nagios/etc/servicetemplates.cfg | grep -Ei 'name' | awk '{print $2}' > servicenames.txtCode: Select all
cat /usr/local/nagios/etc/hosttemplates.cfg | grep -Ei 'name' | awk '{print $2}' > hostservicenames.txtCode: Select all
grep -Eir 'local-service' /usr/local/nagios/etc/ -A 5 -B 5 | grep -Ei 'service_description' | awk '{print $3 $4 $5 $6 $7}'Code: Select all
cat servicenames.txt | while read LINE; do 'find /usr/local/nagios/etc/ -name "*.cfg" -type f exec grep -E '$LINE' {} \; | grep -Ei 'service_description' | awk '{print $3 $4 $5 $6 $7 $8}''; doneOthers on the community forum might have a better workaround so please let us know.
Thanks,
Perry