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