nv-l
[Top] [All Lists]

Re: Simple agent

To: nv-l@lists.tivoli.com
Subject: Re: Simple agent
From: Steve Stamper <sstamper@FOREMOST.COM>
Date: Fri, 28 Jan 2000 15:37:53 -0500
I've kind of 'dummied' this up a bit to protect the innocent, but it gives
you an idea of a system I have in place to report in a specific format.  Run
it from cron.

=====<SNIP>=====
#!/bin/ksh

SNMPWALK=/usr/OV/bin/snmpwalk
WHERE=/usr/local/EOMreports
SNMPTRAP=/usr/OV/bin/snmptrap

gogetaix()
{
    echo "$1  `date`"
    $SNMPWALK $1 .1.3.6.1.4.1.2.6.4.4 > $$.out
    if [ $? > 0 ]; then
        echo "snmpwalk error!"
    fi
    grep "FileSystemName" $$.out | cut -f3 -d":"  > $$a.out
    grep "FileSystemBlock" $$.out | cut -f3 -d":" > $$b.out
    grep "FileSystemBfree" $$.out | cut -f3 -d":" > $$c.out
    printf "  %-20s%20s%20s%6s\n" FileSystemName FileSystemBlock
FileSystemBfree %Used
    paste $$a.out $$b.out $$c.out | \
        awk '{printf "  %-20s%20.0f%20.0f%5.0f%%\n", $1, $2,
$3,(($2-$3)/$2*100)}'
    rm $$a.out $$b.out $$c.out $$.out
    echo "\n"
}


{
gogetaix system1
gogetaix system2
gogetaix system3
} > $WHERE/AIXreport

$SNMPTRAP $1 "" $1 6 5551212 1 .1.3.6.1.4.1.2.6.1 octetstring "AIX Size
Report Ready" 2>/dev/null 2>>$LOGFILE




=====<SNIP>=====

Good Luck
Steve Stamper
Grand Rapids, MI

----- Original Message -----
From: Bob Stamm <Robert_Stamm@RES.RAYTHEON.COM>
To: <NV-L@UCSBVM.UCSB.EDU>
Sent: Friday, January 28, 2000 1:22 PM
Subject: Simple agent


> I am an engineer for Raytheon Co.  Here we build Air Traffic Control
> Systems and I have
> installed NetView for a demo of how we might use it for Control and
> Monitoring of the DEC
> Alpha Unix boxes (now Compaq Computers) we use to power our ATC Controller
> consoles.
>
> What I wonder is if anyone has a sample simple agent (written in C) that
> can be used by me
> to query stuff in the MIB and periodically report to NetView a status of
> some MIB variable.
> Upon receipt of this event I'd like to change a symbol representing the
> status of that agent.
> I'd probably only run the agent on a single workstation since I have to
put
> it into an operational
> ATC installation in Munich and I'm sure I'll have limited access to their
> equipment.
>
> Is there a source of information (sample code) that I can refer to to help
> me put together a
> quick demo?  The only resources I've got are a demo copy of NetView atnd
my
> own wits ...
> A piece of working samplle code would go a long way to help me pull this
> off.
>
> Bob
>


<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web