Page 1 of 1

Automatic service_description from -> mrtg description -> sw

Posted: Wed May 11, 2016 5:52 am
by ThomasJohansen
Hi

I have Nagios core 4.1.1 and mrtg installed, and everything works fine...

Is it somehow possible to get the service_description by automatic from ex. mrtg output.

What I would like to do is, when I change the description text on a port in the switch configuration, I can see the change in the mrtg description (mrtg: "descr"), what I would like to is variable to set into the service_decription when doing the define service{...

Re: Automatic service_description from -> mrtg description -

Posted: Wed May 11, 2016 10:53 am
by rkennedy
You could probably do this, but it would take a custom bash script that does a replace.

Re: Automatic service_description from -> mrtg description -

Posted: Thu May 12, 2016 11:13 am
by ThomasJohansen
I was hoping there was a better way... Since it's usefull in many ways. :) Thx for the answer ;)

Re: Automatic service_description from -> mrtg description -

Posted: Thu May 12, 2016 4:30 pm
by lmiltchev
Let us know if you have any more questions.

Re: Automatic service_description from -> mrtg description -

Posted: Tue May 17, 2016 6:28 am
by nozlaf
when writing your script you should consider pynag http://pynag.org , very handy for doing this sort of config file manipulation on the fly

Re: Automatic service_description from -> mrtg description -

Posted: Tue May 17, 2016 10:36 am
by rkennedy
Thanks @nozlaf!

@ThomasJohansen - let us know if you have any further questions.