I think that script has accurate data, at least on my debian lenny. It gets the load average, not the current load. And memory it will take buffers/cache data. It is really simple though.<div><br></div><div>About SNMP, I have never used it. I was actually going to start figuring it out because it is more reliable and gives you out way more data. I would suggest you to take a look here:</div>
<div><br></div><div><a href="http://vegan.net/MRTG/concepts.php">http://vegan.net/MRTG/concepts.php</a></div><div><br></div><div><a href="http://ruleoftech.wordpress.com/2007/06/18/quick-howto-setting-up-snmp-and-mrtg/">http://ruleoftech.wordpress.com/2007/06/18/quick-howto-setting-up-snmp-and-mrtg/</a></div>
<div><br></div><div>If you must take the data from the snmp, I guess you will have to figure it out, but if you are just using this "for fun" or for curiosity, try some of those scripts, its much easier (not that I'm lazy, hehehe).</div>
<div><br></div><div>Regards,</div><div>Rafael</div><div><br></div><div><br><br><div class="gmail_quote">On Sun, Jul 12, 2009 at 12:53 PM, 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>
On Sun, Jul 12, 2009 at 10:48 PM, Rafael Possamai<<a href="mailto:rafaelpossa@gmail.com">rafaelpossa@gmail.com</a>> wrote:<br>
> I assumed your SNMP+MRTG was set up correctly... But now that you changed it<br>
> and it worked (or at least tried to gather data from it) I think that maybe<br>
> something was going on with SNMP.<br>
<br>
</div>Thanks for the script, I added it to MRTG and as you figured,<br>
something must have gone wrong in the latest update. MRTG started<br>
creating the log files and graphs. Although the data is wrong, I<br>
looked at the loads and it's all zeros, at least now I know what I<br>
should be trying to fix.<br>
<br>
Now working on fixing SNMP, and it appears that despite it working,<br>
somehow it was not actually loading up the required MIBs, or at least<br>
that's my understanding.<br>
<br>
So far I've managed to get SNMP to report cpu load.<br>
<br>
>snmpwalk -v 1 -c public localhost laTable<br>
UCD-SNMP-MIB::laIndex.1 = INTEGER: 1<br>
UCD-SNMP-MIB::laIndex.2 = INTEGER: 2<br>
UCD-SNMP-MIB::laIndex.3 = INTEGER: 3<br>
UCD-SNMP-MIB::laNames.1 = STRING: Load-1<br>
UCD-SNMP-MIB::laNames.2 = STRING: Load-5<br>
UCD-SNMP-MIB::laNames.3 = STRING: Load-15<br>
UCD-SNMP-MIB::laLoad.1 = STRING: 0.10<br>
UCD-SNMP-MIB::laLoad.2 = STRING: 0.18<br>
UCD-SNMP-MIB::laLoad.3 = STRING: 0.17<br>
UCD-SNMP-MIB::laConfig.1 = STRING: 12.00<br>
UCD-SNMP-MIB::laConfig.2 = STRING: 12.00<br>
UCD-SNMP-MIB::laConfig.3 = STRING: 12.00<br>
UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 10<br>
UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 17<br>
UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 17<br>
UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 0.100000<br>
UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 0.180000<br>
UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 0.170000<br>
UCD-SNMP-MIB::laErrorFlag.1 = INTEGER: 0<br>
UCD-SNMP-MIB::laErrorFlag.2 = INTEGER: 0<br>
UCD-SNMP-MIB::laErrorFlag.3 = INTEGER: 0<br>
UCD-SNMP-MIB::laErrMessage.1 = STRING:<br>
UCD-SNMP-MIB::laErrMessage.2 = STRING:<br>
UCD-SNMP-MIB::laErrMessage.3 = STRING:<br>
<br>
<br>
But then this leads me back to MRTG... how do I get MRTG to do the<br>
default pages again? Right now, the only way I could get anything<br>
generated was to follow the example from snmp wiki and manually add<br>
lines like this<br>
<br>
LoadMIBs: /usr/local/share/snmp/mibs/UCD-SNMP-MIB.txt<br>
Target[load]:laLoadInt.1&laLoadInt.2&laLoadInt.3:public@localhost<br>
RouterUptime[load]: public@localhost<br>
MaxBytes[load]: 100<br>
Title[load]: CPU LOAD<br>
PageTop[load]: <H1>CPU Load %</H1><br>
Unscaled[load]: ymwd<br>
ShortLegend[load]: %<br>
YLegend[load]: CPU Utilization<br>
Legend1[load]: 1 Minute (Load)<br>
Legend2[load]: 5 Minute (Load)<br>
Legend3[load]: 15 Minute (Load)<br>
LegendI[load]: User<br>
LegendO[load]: System<br>
Options[load]: growright,nopercent<br>
<br>
This gives me the load.html but the graphs are not what I expect, I'm<br>
still trying to find if there's an equivalent to RouterUptime for cpu<br>
load.<br>
<br>
Thanks again for pointing me in the right direction!<br>
</blockquote></div><br></div>