
|
View Full Version : mrtg.conf
Fremont Servers 01-03-2002, 03:51 AM Hello,
If you create your own mrtg.conf, you don't have to run cfgmaker...am I correct?
Whenever a server is added, I need to run cfgmaker again for it to recognize the new server. If you create your own mrtg.conf, running cfgmaker would mess up your customized mrtg.conf..am I coorect. If so, I would you do it?
Also, what do you recommend for WorkDir?
If I put /home/mrtg as WorkDir, then I have to "ln -s" it to a path where it is viewable by the web.
If I create it at a path where it is viewable by the web, do you see any disadvantage?
:cool:
cperciva 01-03-2002, 04:15 AM Originally posted by Asia
If you create your own mrtg.conf, you don't have to run cfgmaker...am I correct?
Whenever a server is added, I need to run cfgmaker again for it to recognize the new server. If you create your own mrtg.conf, running cfgmaker would mess up your customized mrtg.conf..am I coorect. If so, I would you do it?
You're quite correct -- cfgmaker, as its name implies, makes MRTG's configuration file, and if you edit mrtg.conf yourself cfgmaker is quite unnecessary. If I were you I'd look at the configuration file it creates, understand what the directives mean, and then throw cfgmaker away and edit mrtg.conf by hand.
Also, what do you recommend for WorkDir?
Personally I like /usr/local/account/rrd, but that's just because I have some personal additions (eg 95th percentile computation) in the same directory and my other accounting code elsewhere under /usr/local/account.
If I put /home/mrtg as WorkDir, then I have to "ln -s" it to a path where it is viewable by the web.
If I create it at a path where it is viewable by the web, do you see any disadvantage?
I'd suggest keeping the WorkDir in a private non-web-accessible directory. I don't know of any security risks (unless you have passworded SNMP switches) but there's no reason to leak information. You can put different WorkDir, HtmlDir, and ImageDir directives, which will allow you to have it create the necessary html and images in an http-accessible directory.
If you're monitoring several data sources, it will be faster to use RRDTool instead; in that case you can keep all the files in a private directory, telling 14all.cgi where to find them. (Assuming you're using suexec... but of course you are, right?)
Fremont Servers 01-03-2002, 04:29 AM If you create your own mrtg.conf, how do you get MRTG to update when something (server) is added to one of the ports that MRTG is monitoring? Should I say how will I get MRTG to reread mrtg.conf, find, update, and create a graph for a newly added server to one of the ports on the cisco switch?
cperciva 01-03-2002, 04:34 AM Just edit the configuration file to add a new section for the new target, and MRTG will create the appropriate files the next time it is run (by cron, presumably).
It might produce an error message the next one or two times when it creates the files, but apart from that it should start monitoring the new target without a hitch.
Fremont Servers 01-03-2002, 04:42 AM # File Name: mrtg.cfg
WorkDir: /home/mrtg
Title[_]: Cisco Catalyst 2924
Options[_]: integer, noinfo, bits, unknaszero, growright
YLegend[_]: Bits per Second
Kilo[_]: 1024
WithPeak[_]: my
Legend1[_]: Bits In
Legend2[_]: Bits Out
LegendI[_]: In
LegendO[_]: Out
# Cisco Catalyst 2924
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Target[Port-1]: 2:<Comm String>$@<IP Address>
MaxBytes[Port-1]: 12500000
PageTop[Port-1]: <FONT SIZE="6"><B>To Port 1</B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/1 ]</FONT>
#.....................................................................
Target[Port-2]: 3:<Comm String>$@1.1.1.1
MaxBytes[Port-2]: 12500000
PageTop[Port-2]: <FONT SIZE="6"><B>To Port 2 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/2 ]</FONT>
]</FONT>
#---------------------------------------------------------------
Target[Port-3]: 4:<Comm String>$@1.1.1.1
MaxBytes[Port-3]: 12500000
PageTop[Port-3]: <FONT SIZE="6"><B>To Port 3 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/3 ]</FONT>
#---------------------------------------------------------------
Target[Web-mail]: 5:<Comm String>$@1.1.1.1
MaxBytes[Web-mail]: 1250000
PageTop[Web-mail]: <FONT SIZE="6"><B>To Port Web Mail </B></FONT><FONT COLOR="000099" SIZE="5"> [Ethernet Port 0/4 ]</FONT>
#---------------------------------------------------------------
Target[Port-5]: 6:<Comm String>$@1.1.1.1
MaxBytes[Port-5]: 12500000
PageTop[Port-5]: <FONT SIZE="6"><B>To Port 5 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/5 ]</FONT>
#---------------------------------------------------------------
Target[Port-6]: 7:<Comm String>$@1.1.1.1
MaxBytes[Port-6]: 12500000
PageTop[Port-6]: <FONT SIZE="6"><B>To Port 6 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/6 ]</FONT>
#---------------------------------------------------------------
Target[Port-7]: 8:<Comm String>$@1.1.1.1
MaxBytes[Port-7]: 12500000
PageTop[Port-7]: <FONT SIZE="6"><B>To Port 7 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/7 ]</FONT>
#---------------------------------------------------------------
Target[Port-8]: 9:<Comm String>$@1.1.1.1
MaxBytes[Port-8]: 12500000
PageTop[Port-8]: <FONT SIZE="6"><B>To Port 8 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/8 ]</FONT>
#---------------------------------------------------------------
Target[Port-9]: 10:<Comm String>$@1.1.1.1
MaxBytes[Port-9]: 12500000
PageTop[Port-9]: <FONT SIZE="6"><B>To Port 9 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/9 ]</FONT>
#---------------------------------------------------------------
Target[Port-10]: 11:<Comm String>$@1.1.1.1
MaxBytes[Port-10]: 12500000
PageTop[Port-10]: <FONT SIZE="6"><B>To Port 10 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/10 ]</FONT>
#---------------------------------------------------------------
Target[Port-11]: 12:<Comm String>$@1.1.1.1
MaxBytes[Port-11]: 12500000
PageTop[Port-12]: <FONT SIZE="6"><B>To Port 11 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/11 ]</FONT>
#---------------------------------------------------------------
Target[Port-12]: 13:<Comm String>$@1.1.1.1
MaxBytes[Port-12]: 12500000
PageTop[Port-12]: <FONT SIZE="6"><B>To Port 12 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/12 ]</FONT>
#---------------------------------------------------------------
Target[Port-13]: 14:<Comm String>$@1.1.1.1
MaxBytes[Port-13]: 12500000
PageTop[Port-13]: <FONT SIZE="6"><B>To Port 13 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/13 ]</FONT>
#---------------------------------------------------------------
Target[Port-14]: 15:<Comm String>$@1.1.1.1
MaxBytes[Port-14]: 12500000
PageTop[Port-14]: <FONT SIZE="6"><B>To Port 14 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/14 ]</FONT>
#---------------------------------------------------------------
Target[Port-15]: 16:<Comm String>$@1.1.1.1
MaxBytes[Port-15]: 12500000
PageTop[Port-15]: <FONT SIZE="6"><B>To Port 15 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/15 ]</FONT>
#---------------------------------------------------------------
Target[Port-16]: 17:<Comm String>$@1.1.1.1
MaxBytes[Port-16]: 12500000
PageTop[Port-16]: <FONT SIZE="6"><B>To Port 16 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/16 ]</FONT>
#---------------------------------------------------------------
Target[Port-17]: 18:<Comm String>$@1.1.1.1
MaxBytes[Port-17]: 12500000
PageTop[Port-17]: <FONT SIZE="6"><B>To Port 17 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/17 ]</FONT>
#---------------------------------------------------------------
Target[Port-18]: 19:<Comm String>$@1.1.1.1
MaxBytes[Port-18]: 12500000
PageTop[Port-18]: <FONT SIZE="6"><B>To Port 18 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/18 ]</FONT>
#---------------------------------------------------------------
Target[Port-19]: 20:<Comm String>$@1.1.1.1
MaxBytes[Port-19]: 12500000
PageTop[Port-19]: <FONT SIZE="6"><B>To Port 19 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/19 ]</FONT>
#---------------------------------------------------------------
Target[Port-20]: 21:<Comm String>$@1.1.1.1
MaxBytes[Port-20]: 12500000
PageTop[Port-20]: <FONT SIZE="6"><B>To Port 20 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/20 ]</FONT>
#---------------------------------------------------------------
Target[Port-21]: 22:<Comm String>$@1.1.1.1
MaxBytes[Port-21]: 12500000
PageTop[Port-21]: <FONT SIZE="6"><B>To Port 21 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/21 ]</FONT>
#---------------------------------------------------------------
Target[Port-22]: 23:<Comm String>$@1.1.1.1
MaxBytes[Port-22]: 12500000
PageTop[Port-22]: <FONT SIZE="6"><B>To Port 22 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/22 ]</FONT>
#---------------------------------------------------------------
Target[Port-23]: 24:<Comm String>$@1.1.1.1
MaxBytes[Port-23]: 12500000
PageTop[Port-23]: <FONT SIZE="6"><B>To Port 23 </B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/23 ]</FONT>
#---------------------------------------------------------------
Target[Port-24]: 25:<Comm String>$@1.1.1.1
MaxBytes[Port-24]: 12500000
PageTop[Port-24]: <FONT SIZE="6"><B>To Port 24</B></FONT><FONT COLOR="000099" SIZE="5"> [F.E Port 0/24 ]</FONT>
RunAsDaemon: yes
If the about is my mrtg.conf, what changes should I make if a new server is added to one of the ports on the cisco switch?
Do I need to do anything if my mrtg.conf is like that?
cperciva 01-03-2002, 04:45 AM Well, it looks like MRTG is already monitoring all the ports, so you shouldn't need to change anything. When you start using one of the ports the associated graph will stop showing a line at zero. ;)
Fremont Servers 01-03-2002, 04:51 AM Thank you very much for helping me out, cperciva .
Do you think I should name port1 as 2, port2 as 3, and etc, or should I name port1 as 1, port2 as 2?
cperciva 01-03-2002, 04:53 AM Well, it's up to you... but personally I'd call port 1 port 1.
Fremont Servers 01-03-2002, 04:59 AM I got the above mrtg.conf from someone.
I was thinking why would you call port1 as 2, port2 as 3, and etc.
I took a look at [F.E Port 0/1 ] on port1, and I was wondering if [F.E Port 0/0 ] exists.
cperciva 01-03-2002, 05:02 AM That configuration file might have come from someone with a "24 plus uplink" port switch, which would explain the odd numbering.
Fremont Servers 01-03-2002, 05:04 AM Thanks.
I'll put port1 as 1, port2 as 2, and etc.
:cool:
|