AS400 CPU Utilization

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

anh
Posts: 9
Joined: Wed Nov 09, 2005 5:59 am

Post by anh »

Do you have a working template ?
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Attached is what I've been able to graph from our AS400...wish i could get more!!!!
Attachments
as400.PNG
as400.PNG (65.49 KiB) Viewed 20730 times
jcheney
Posts: 8
Joined: Tue Aug 15, 2006 1:48 pm
Contact:

Template?

Post by jcheney »

I don't suppose you could export a template, or provide the OIDs you used for those graphs...
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

I'm using these OIDs to graph AS/400 :
  • .1.3.6.1.2.1.25.1.5.0 (hrSystemNumUsers) for logged in users
  • .1.3.6.1.2.1.25.1.6.0 (hrSystemProcesses) for running processes
  • .1.3.6.1.4.1.2.6.4.5.1.0 for CPU usage
  • hrStorageSize and hrStorageUsed for disk usage (with index=1)
  • .1.3.6.1.2.1.25.2.2.0 (hrMemorySize) for memory size, and a script which get the index of memory usage in hrStorageAllocationUnits
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
MBurroughs
Posts: 1
Joined: Wed Aug 16, 2006 8:19 am
Location: Middle of States

Post by MBurroughs »

Spoonman, Where did you get the templates that you used to graph the AS400? Are you using AS400 temps or are they Windows templates..
jcheney
Posts: 8
Joined: Tue Aug 15, 2006 1:48 pm
Contact:

Post by jcheney »

Thanks fmangeant, I was able to get everything but the disk and memory usage, but it would appear that this particular machine is not returning those values. When I do an snmpwalk they don't show up, and when doing an snmpget they return a noSuchName error.

Thanks for your help!
jcheney
Posts: 8
Joined: Tue Aug 15, 2006 1:48 pm
Contact:

Post by jcheney »

I thought that I would post the template I have. It needs work still, but it might be a place for someone to start.
Attachments
as400-cacti.xml
Cacti Template for AS/400
(174.25 KiB) Downloaded 1631 times
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Here are some that I use - AS400

Post by spoonman »

I wish I could get more from the As400// num jobs I haven't figured out how to use the storage OID's to get Hard drive space graphs etc...
Attachments
cacti_graph_template_as400_cpu_utilization.xml
(10.22 KiB) Downloaded 1163 times
cacti_graph_template_as400_numusers_sessions.xml
(9.9 KiB) Downloaded 1322 times
cacti_graph_template_as400_ram_total.xml
(10.23 KiB) Downloaded 1508 times
cacti_graph_template_as400_total_processes.xml
(9.9 KiB) Downloaded 1295 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Re: Here are some that I use - AS400

Post by fmangeant »

spoonman wrote:I wish I could get more from the As400// num jobs I haven't figured out how to use the storage OID's to get Hard drive space graphs etc...
For memory, I'm using this quick and dirty script :

Code: Select all

$ cat get-as400-memory.sh

#!/bin/sh

IP=$1
COMMUNITY=$2
SNMP_VERSION=$3
MACHINE=$4

# RAM total size
RAM_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrMemorySize.0 | awk '{ print $(NF-1) }'`
RAM_SIZE=`expr $RAM_SIZE`

# RAM used
NB_ELEMENTS=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageIndex | awk '{ print $NF }' | tail -n 1`

RAM_USED=0

for i in `seq 1 $NB_ELEMENTS`; do
        TYPE_ELEMENT=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageDescr.$i | awk '{ print $NF }'`
        if [ "$TYPE_ELEMENT" != "RAM" ]; then
                continue
        fi

        BLOCK_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageAllocationUnits.$i | awk '{ print $(NF-1) }'`
        NB_BLOCKS_USED=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageUsed.$i | awk '{ print $NF }'`
        RAM_USED=`expr $NB_BLOCKS_USED \* $BLOCK_SIZE`
        TOTAL_RAM_USED=`expr $TOTAL_RAM_USED + $RAM_USED`
done

TOTAL_RAM_USED=`expr $TOTAL_RAM_USED / 1024`
RAM_FREE=`expr $RAM_SIZE - $TOTAL_RAM_USED`

echo "valeur1:$RAM_FREE valeur2:$RAM_SIZE"
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

How do you use it??
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

I've created a data input method which runs a script, and gets 2 results in return.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
jtnfoley
Posts: 5
Joined: Tue Aug 15, 2006 12:56 pm
Location: MA, USA

OS400 5.3 RAM script

Post by jtnfoley »

I had to prowl around with getif to sniff out the OIDs and changed the behavior of the awks a little, but...
This seems to work with OS/400 5.3, on Fedora Core 4 as the cacti host. I'm still trying to get everything plumbed together and actually make a graph, however...
NET-SNMP version: 5.3.1, FWIW.

Code: Select all


#!/bin/sh

IP=$1
COMMUNITY=$2
SNMP_VERSION=$3
MACHINE=$4

# RAM total size
#RAM_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrMemorySize.0 | awk '{ print $(NF-1) }'`
RAM_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.2 | awk '{ print $(NF) }'`
RAM_SIZE=`expr $RAM_SIZE`

# RAM used
#NB_ELEMENTS=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageIndex | awk '{ print $NF }' | tail -n 1`
NB_ELEMENTS=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.1 | awk '{ print $NF }' | tail -n 1`
RAM_USED=0

for i in `seq 1 $NB_ELEMENTS`; do
        #TYPE_ELEMENT=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageDescr.$i | awk '{ print $NF }'`
        TYPE_ELEMENT=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.3.$i | awk '{ print $(NF-1) }'`
        if [ "$TYPE_ELEMENT" != "\"RAM" ]; then
                continue
        fi

#        BLOCK_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageAllocationUnits.$i | awk '{ print $(NF-1) }'`
        BLOCK_SIZE=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.4.$i | awk '{ print $(NF) }'`
       # NB_BLOCKS_USED=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP hrStorageUsed.$i | awk '{ print $NF }'`
        NB_BLOCKS_USED=`snmpwalk -v $SNMP_VERSION -c $COMMUNITY $IP .1.3.6.1.2.1.25.2.3.1.6.$i | awk '{ print $NF }'`
        RAM_USED=`expr $NB_BLOCKS_USED \* $BLOCK_SIZE`
        TOTAL_RAM_USED=`expr $TOTAL_RAM_USED + $RAM_USED`
done

TOTAL_RAM_USED=`expr $TOTAL_RAM_USED / 1024`
RAM_FREE=`expr $RAM_SIZE - $TOTAL_RAM_USED`

echo "valeur1:$RAM_FREE valeur2:$RAM_SIZE"


jtnfoley
Posts: 5
Joined: Tue Aug 15, 2006 12:56 pm
Location: MA, USA

Post by jtnfoley »

My D'OH! moment of the day...
Put the mib in /usr/local/share/snmp/mibs/ and changed the snmpwalk commands to include "-m all" and the (otherwise) original script now works. With "-m all" the performance is far slower than with the OIDs above...
"-m IBM-AS400-RWS-MIB.txt" errors, even with absolute path...
Alberello
Posts: 6
Joined: Tue Nov 21, 2006 10:16 am
Contact:

templates doesn't work...

Post by Alberello »

Hello,
I am just able to monitor the number of process...

what I have to put here in OID?
I have a OS/400 V5R3M0

Image
dafa
Posts: 1
Joined: Fri Aug 05, 2011 7:32 am

Re: AS400 CPU Utilization

Post by dafa »

Can someone post an example of how to use the sh script to check AS/400 memory usage ?

Thanx.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest