I assumed your SNMP+MRTG was set up correctly... But now that you changed it and it worked (or at least tried to gather data from it) I think that maybe something was going on with SNMP. On my server I take all the data from shell scripts, for example:<div>
<br></div><div>mrtg-load (memory and cpu)</div><div>mrtg-ip-acct (e.g. eth0)</div><div><br></div><div>Once I took data from sensors (lm-sensors) and it was working fine. After I rebooted the server I noticed it stopped showing any new data with no error messages. What happened was that the output was always 0 because the modules for lm-sensors weren't loaded. So maybe your SNMP was giving MRTG useless data like null/zero. </div>
<div><br></div><div>Here is a script for memory/cpu script: <a href="http://www.ext3.com.br/cpu.sh">http://www.ext3.com.br/cpu.sh</a></div><div><br></div><div>wget that, chmod +x cpu.sh and the lines for it on mrtg.cfg should look something like this:</div>
<div>--------</div><div><div># Performance</div><div><b>Target[perf]:`/path/to/cpu.sh`</b></div><div>Title[perf]:"Average cpu load and memory use"</div><div>PageTop[perf]:"<h1>Average cpu load and memory use</h1>"</div>
<div>Options[perf]: growright,gauge,nopercent,noinfo,nobanner</div><div>YLegend[perf]: Percentual</div><div>ShortLegend[perf]: %</div><div>MaxBytes[perf]: 100</div><div>Legend1[perf]: CPU Load</div><div>Legend2[perf]: Memory use</div>
<div>LegendI[perf]: Load</div><div>LegendO[perf]: Mem</div><div>--------</div><div><br></div><div>If it works just fine... I would say your problem is at the snmp set up.</div><div><br></div><div>Rafael.</div><div><br></div>
</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Sun, Jul 12, 2009 at 11:14 AM, Noob Centos Admin <span dir="ltr"><<a href="mailto:centos.admin@gmail.com">centos.admin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<div class="im"><br>
> 1. it is pretty simple to work with. you just have to set up a mrtg.cfg file<br>
> and it should work fine even when you have a very minimal configuration.<br>
> 2. permissions are something that may botter you if there's even one file<br>
> that the daemon can't read/write/execute, but it should be easy to fix when<br>
> you have access to log files.<br>
> 3. try setting up the options for a log directory. add the following line to<br>
> your conf file if you don't have one like that yet:<br>
> Logdir: /etc/mrtg/logs<br>
> make sure the path exists and has the proper permissions.<br>
> 4. make sure that mrtg is being ran under root user and group. if you change<br>
> mrtg's user and group you will have to change all those permissions again.<br>
> 5. use -R with chmod when you change permissions of directories with files<br>
> on it, so it will apply for everything, not only the main directory your<br>
> working with. e.g.: chmod -R 777 /etc/mrtg /var/html/www/mrtg/<br>
> 6. backup all your data from /var/html/www/mrtg/ and delete it from there<br>
> and try to run mrtg as it was it's first time being ran.<br>
<br>
</div>I mv away the existing mrtg directory in my /var/html/www directory,<br>
then used cfgmaker public@localhost to create a most minimal cfg file,<br>
adding only the Workdir and Logdir. Basically apart from comment<br>
lines, there appears only to be 3 effective lines, e.g. workdir,<br>
logdir and EnableIPv6: no<br>
<br>
The mrtg binary files and the output directories are all under root<br>
currently, permissions on everything in the output folder to 777 to<br>
eliminate any potential permissions problem.<br>
<br>
Running from command line, the same thing happens. MRTG recreates the<br>
missing MRTG header pictures in the workdir, including the zero byte<br>
mrtg.ok (is this supposed to be zero byte?). However, no log files are<br>
created in the log folder.<br>
<br>
Logging is done, I had tail -f on the file and updates accordingly<br>
with no error message whatsoever.<br>
<br>
<pre><br>
2009-07-12 21:59:53 -- Started mrtg with config<br>
<div class="im">'/var/www/html/mrtg/core/mrtg.cfg'<br>
</div>2009-07-12 21:59:53 -- --base: Creating Lockfiles<br>
/var/www/html/mrtg/core/mrtg.cfg_l,/var/www/html/mrtg/core/mrtg.cfg_l_21308<br>
2009-07-12 21:59:53 -- --base: Reading Config File:<br>
<div class="im">/var/www/html/mrtg/core/mrtg.cfg<br>
</div>2009-07-12 21:59:53 -- --base: Reading Interface Config cache<br>
2009-07-12 21:59:53 -- --base: Checking Config File<br>
2009-07-12 21:59:53 -- --base: Loading default Locale<br>
2009-07-12 21:59:53 -- --base: Starting main Loop<br>
2009-07-12 21:59:53 -- --base: Populate Target object by polling SNMP<br>
and external Datasources<br>
2009-07-12 21:59:53 -- --base: Exit main Loop<br>
2009-07-12 21:59:53 -- --base: Remove Lock Files<br>
2009-07-12 21:59:53 -- --base: Store Interface Config Cache<br>
</pre><br>
<br>
I tried add an example from<br>
<a href="http://net-snmp.sourceforge.net/wiki/index.php/TUT:MRTG" target="_blank">http://net-snmp.sourceforge.net/wiki/index.php/TUT:MRTG</a> where it uses<br>
more advanced MRTG commands with SNMP to monitor CPU usage. This had<br>
the effect of MRTG logging SNMP errors, specifically, the log file now<br>
show actual attempt to get data from SNMP.<br>
<br>
So this makes me wonder if the default setup wasn't working and MRTG<br>
was not even polling for data due to some unknown problem. Is there<br>
some way to make MRTG tell what data it is seeing or is it getting any<br>
data when trying to get the default data like load and network<br>
traffic?<br>
<div><div></div><div class="h5"><br>
_______________________________________________<br>
mrtg mailing list<br>
<a href="mailto:mrtg@lists.oetiker.ch">mrtg@lists.oetiker.ch</a><br>
<a href="https://lists.oetiker.ch/cgi-bin/listinfo/mrtg" target="_blank">https://lists.oetiker.ch/cgi-bin/listinfo/mrtg</a><br>
</div></div></blockquote></div><br></div>