Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This site is a great forum to exchange knowledge..."

Geography

Where in the world do Tek-Tips members come from?
panhandles (Vendor)
2 May 02 10:49
I've just started using the RML tools. I' m trying to use custcfg to generate a config.
How can I type in several Managers at the input prompt and finish by pressing return.
In the template.rpt example it says:
@
## this sub-section will be replicated for each
## $ipaddr$ supplied from the input database
      SNMP Manager Entry (wfSnmpMgrEntry)
          wfSnmpMgrCommIndex<i0> = $comm$
          wfSnmpMgrAddress<i1> = $ipaddr$
@
Here I was only prompted for one IP address. Has anyone made their own template.rpt and can help me to get started?

Thanks, Peter
katamann (MIS)
14 May 02 6:27
Hi

I'm not familiar with the custcfg application. But here is a batch file which adds communities and ip-ranges of managers. Edit the file to match your needs, save it on the flash and run from TI. This script will delete all the old communities and managers.

easysnmp.bat:
#  SNMP ease communities and managers creation
#  requires software rel/8.01 or higher
#  Edit to match your needs
#

on error :ERROR:
# Edit the ip ranges to match your addresses
setenv SUBNET1 "192.168.27"
let first_mgr1 = 196
let last_mgr1 = 200

setenv SUBNET2 "172.18.110"
let first_mgr2 = 15
let last_mgr2 = 16

setenv SUBNET3 "10.0.0"
let first_mgr3 = 9
let last_mgr3 = 10


# Delete all existing managers
setenv      nextid  "*"
setenv      nextflag ""
arrayenv    attr    wfSnmpMgrCommIndex wfSnmpMgrAddress
enumenv     1       index address
:DEL_MGR_LOOP:
    mibget $nextflag wfSnmpMgrEntry attr $nextid value nextid
    if "$nextid" = "END" then; goto :DEL_MGR_LOOP_EXIT:
    set wfSnmpMgrEntry.wfSnmpMgrDelete.${value[$index]}.${value[$address]} 2
    setenv nextflag "-n"
    goto :DEL_MGR_LOOP:
:DEL_MGR_LOOP_EXIT:
commit

# Delete all existing community names
setenv      nextid  "*"
setenv      nextflag ""
arrayenv    attr    wfSnmpCommIndex
enumenv     1       index
:DEL_LOOP_COM:
    mibget $nextflag wfSnmpCommEntry attr $nextid value nextid
    if "$nextid" = "END" then; goto :DEL_LOOP_COM_EXIT:
    set wfSnmpCommEntry.wfSnmpCommDelete.${value[$index]} 2
    setenv nextflag "-n"
    goto :DEL_LOOP_COM:
:DEL_LOOP_COM_EXIT:
commit

# Add new community names
set wfSnmpCommEntry.wfSnmpCommDelete.1 1
set wfSnmpCommEntry.wfSnmpCommDelete.2 1
set wfSnmpCommEntry.wfSnmpCommDelete.3 1
# These lines defines the community names
set wfSnmpCommEntry.wfSnmpCommName.1 "community1"
set wfSnmpCommEntry.wfSnmpCommName.2 "community2"
set wfSnmpCommEntry.wfSnmpCommName.3 "community3"
# These lines define read or read-write
set wfSnmpCommEntry.wfSnmpCommAccess.1 2
set wfSnmpCommEntry.wfSnmpCommAccess.2 1
set wfSnmpCommEntry.wfSnmpCommAccess.3 1
commit

# Add new managers1
setenv      nextid  "*"
setenv      nextflag ""
let i = $first_mgr1
:ADD_LOOP_MGR1:
    if "$i" > "$last_mgr1" then; goto :ADD_LOOP_EXIT1:
    set wfSnmpMgrEntry.wfSnmpMgrDelete.1.$SUBNET1.$i 1
    set wfSnmpMgrEntry.wfSnmpMgrTraps.1.$SUBNET1.$i 1
    let i = $i + 1
    setenv nextflag "-n"
    goto :ADD_LOOP_MGR1:
:ADD_LOOP_EXIT1:
commit

# Add new managers2
setenv      nextid  "*"
setenv      nextflag ""
let i = $first_mgr2
:ADD_LOOP_MGR2:
    if "$i" > "$last_mgr2" then; goto :ADD_LOOP_EXIT2:
    set wfSnmpMgrEntry.wfSnmpMgrDelete.2.$SUBNET2.$i 1
    set wfSnmpMgrEntry.wfSnmpMgrTraps.2.$SUBNET2.$i 1
    let i = $i + 1
    setenv nextflag "-n"
    goto :ADD_LOOP_MGR2:
:ADD_LOOP_EXIT2:
commit
# Add new managers3
setenv      nextid  "*"
setenv      nextflag ""
let i = $first_mgr3
:ADD_LOOP_MGR3:
    if "$i" > "$last_mgr3" then; goto :ADD_LOOP_EXIT3:
    set wfSnmpMgrEntry.wfSnmpMgrDelete.3.$SUBNET3.$i 1
    set wfSnmpMgrEntry.wfSnmpMgrTraps.3.$SUBNET3.$i 1
    let i = $i + 1
    setenv nextflag "-n"
    goto :ADD_LOOP_MGR3:
:ADD_LOOP_EXIT3:
commit
goto :EXIT:
:ERROR:
echo
echo This script requires software rel/8.01 or higher
:EXIT:
echo Communities and managers added


---
Hope this was of help
Katamann@hotmail.com

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close