Automatic service_description from -> mrtg description -> sw

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ThomasJohansen
Posts: 13
Joined: Wed Dec 30, 2015 6:47 am

Automatic service_description from -> mrtg description -> sw

Post 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{...
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Automatic service_description from -> mrtg description -

Post by rkennedy »

You could probably do this, but it would take a custom bash script that does a replace.
Former Nagios Employee
ThomasJohansen
Posts: 13
Joined: Wed Dec 30, 2015 6:47 am

Re: Automatic service_description from -> mrtg description -

Post by ThomasJohansen »

I was hoping there was a better way... Since it's usefull in many ways. :) Thx for the answer ;)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Automatic service_description from -> mrtg description -

Post by lmiltchev »

Let us know if you have any more questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: Automatic service_description from -> mrtg description -

Post 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
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Automatic service_description from -> mrtg description -

Post by rkennedy »

Thanks @nozlaf!

@ThomasJohansen - let us know if you have any further questions.
Former Nagios Employee
Locked