If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From - Fri Jun 30 08:23:24 2000 Path: news.randori.com!news-feeder2.wcg.net!WCG!nntp.abs.net!feeder.qis.net!news.maxwell.syr.edu!newsfeed.stanford.edu!sn-xit-03!supernews.com!sn-inject-01!corp.supernews.com!not-for-mail From: Jeff Volckaert <JVolckaert@BellMemorial.org> Newsgroups: comp.unix.sco.misc,comp.dcom.net-management Subject: Re: SCO 5.0.5 SNMP Agent not reporting Processor Load Date: Fri, 30 Jun 2000 08:13:33 -0400 Organization: Posted via Supernews, http://www.supernews.com Lines: 187 Message-ID: <395C8EED.4555A4D7@BellMemorial.org> References: <395B7E20.1BB3CDB6@BellMemorial.org> <fo1nlso43ulbg9t5bk1sdjmalv07il6mhj@4ax.com> <jb0ols4ttk56ue3plo8jmv85loliajp39h@4ax.com> X-Complaints-To: newsabuse@supernews.com X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i586) X-Accept-Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Xref: news.randori.com comp.unix.sco.misc:62464 comp.dcom.net-management:4241 X-Mozilla-Status: 8010 X-Mozilla-Status2: 00000000 Wow, thanks for the detailed reply. The funny thing is, my other 5.0.5 box is reporting CPU load just fine. On it I use hrProcessorLoad.8 and on the first box I use hrProcessorLoad.12. I assume the numbering is different on each box depending on installed hardware? Jeff Volckaert
Jeff Liebermann wrote: > On Thu, 29 Jun 2000 10:48:55 -0700, Jeff Liebermann > <jeffl@comix.santa-cruz.ca.us> wrote: > > >On Thu, 29 Jun 2000 12:49:36 -0400, Jeff Volckaert > ><JVolckaert@BellMemorial.org> wrote: > > > >>I am using MRTG to graph CPU load via the SNMP agents on my 2 > >>SCO servers, my Linux Server, and my AS/400. The problem is that only > >>one SCO box is reporting CPU load. The other reports 0 when I query > >>hrProcessorLoad. I've enable SAR on both and can do 'sar -u' without > >>trouble. I've resetup SNMP a couple of times without any luck. > >> > >>Anyone else run into this or have any advice? > > > >Duz it *REPORT* a 0 load, or does it simply graph zero as in no-response? > >I'll assume the OID is correct as it's working on other machines. > >Any particular MRTG version? > > > >My guess is that you don't have hostmib installed or working. > > > >See: > > http://www.cruzio.com/~jeffl/sco/snmp_install.txt > >for how to setup SNMP on SCO servers. Use: > > getmany localhost public iso > >to dump the whole tree and see what it's really reporting. If you get a > >large block of zeros in the mib-2.25 section (hostmib), something is > >broken in the VTCL hostmib pretzel. > > Groan. Bad guess. I'm in my office and I just did a quick test. It > doesn't work on OSR5. hrProcessorLoad.7 does not return the 1 minute > load average as advertised in RFC1514. The OID should be: > 1.3.6.1.2.1.25.3.3.1.1.7 > I'll do the bug report thing later. Meanwhile I have a workaround > that will extract any value for graphing with just a simple shell > script. You can expand the method to graph just about anything that > will belch a number. > > I use the following shell script, idle.sh as a starting point: > ================ > > #!/bin/sh > # @(#) idle.sh Belch current idle percentage for mrtg graphing. > # Remember to have two output numbers on different lines. > # > # Typical output of sar -u 1 > # 21:25:20 %usr %sys %wio %idle > # 21:25:21 0 4 5 92 > # > # Really disgusting way to get rid of extra leading spaces > # by feeding it to a shell variable. Retch. > bletch=`sar -u 1 | tail -1` > echo $bletch | cut -d" " -f5 > echo $bletch | cut -d" " -f5 > > ================ > > # Local sar idle time for mrtg.cfg. > Target[idle]: `idle.sh` > Title[idle]: Sar Idle Percentage > PageTop[idle]: <H1>Sar Idle Percentage</H1> > Options[idle]: growright, gauge > MaxBytes[idle]: 100 > #WithPeak[idle]: dwmy > Unscaled[idle]: dwmy > YLegend[idle]: Idle > ShortLegend[idle]: Idle > > ================ > > This works nicely on the local machine and will graph the > idle percentage. No big deal. However there are many ways > to get the same results from a remote machine. > > 1. rcmd > Modify the bletch= line to read: > bletch=`rcmd $1 "sar -u 1 | tail -1"` > which will run the sar -u 1 command on a remote system > passed as arguement $1. The line in the mrtg.cfg file > would read: > Target[192.168.111.1]:`idle.sh 192.168.111.1` > to get idle statistics from 192.168.111.1. This requires > some security games with hosts.equiv. > > 2. Telnet to an IP socket. > Edit /etc/inetd.conf and add the line: > space stream tcp nowait root /usr/bin/sar -u 1 > to the bottom of the file. > > Edit /etc/services and add the line: > space 9999/tcp # sar idle percentage report > > Find the PID for inetd and signal it to re-read > it's configuration files with: > ps -ef | grep inetd > root 333 1 0 Aug 9 ? 0:29 ietd > kill -1 333 > You will need to do this again for any other changes in > /etc/services and /etc/inetd.conf > > Test with: > telnet localhost 9999 > which should belch: > > comix comix 3.2 2 i386 09/02/98 > 21:49:13 %usr %sys %wio %idle > 21:49:14 0 3 0 97 > > ===================== > > A much more complex example is how to extract freemem and freeswp from > the sar output which require scaleing and a bit of math. > > #!/bin/ksh > # by Jeff Liebermann 04/23/98 > # > # Get sar -r paging output for MRTG > # > # Output of sar -r 1 from SCO Unix. > # SCO_SV sloth 3.2v5.0.2 Pentium 04/23/98 > # 21:32:03 freemem freeswp > # 21:32:04 2990 108912 > # > # > # path dev swaplo blocks free > # /dev/swap 1,41 0 120000 109056 > # > # Freemem is in 4KB pages and freeswp is in 512 byte blocks. > # > # Really disgusting way to get rid of extra leading spaces > # by feeding it to a shell variable. Ugly at best. > # > # Define as variables as int. (ksh only does int) > typeset -i ram swapsize freemem freeswap > # > # Define memory and swap sizes > let ram="16 * 1024000" # ram size in bytes. > swapsize=120000 # block count from swap -l > # > retch=`sar -r 1 | tail -1` # get last line only > set $retch # break apart into fields using IFS > seperators > # > let freemem="$2 * 4096 * 100 / $ram" # convert to percent > echo $freemem # belch % freemem > # > let freeswap="$3 * 100 / $swapsize" # calculate swap percent > echo $freeswap # belch % freeswap > # > > ============ > > # Swap info from sar. > # > # Be sure to set MaxBytes to a realistic value > # based upon the number of 512byte blocks in > # the swap. This is my 60MB swap output of > # the swap -l command. > # path dev swaplo blocks free > # /dev/swap 1,41 0 120000 109056 > Target[paging.4]: `sarr.sh` > Title[paging.4]: Percent FreeMem and FreeSwap > PageTop[paging.4]: <H1>Percent FreeMem and FreeSwap</H1> > Options[paging.4]: growright, gauge, nopercent > MaxBytes[paging.4]: 100 > Unscaled[paging.4]: dwmy > YLegend[paging.4]: % Avail > ShortLegend[paging.4]: % > Legend1[paging.4]: Avg FreeMem Percent > Legend2[paging.4]: Avg FreeSwap Percent > LegendI[paging.4]: FreeMem > LegendO[paging.4]: FreeSwap > > # Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060 > # 831.336.2558 voice > # 831.426.1240 fax http://www.cruzio.com/~jeffl > # 831.421.6491 digital_pager jeffl@comix.santa-cruz.ca.us
/Bofcusm/427.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar