Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RML Tools (CUSTCFG, RPT2CFG)

Status
Not open for further replies.

panhandles

Vendor
May 2, 2002
2
DE
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
 
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 &quot;192.168.27&quot;
let first_mgr1 = 196
let last_mgr1 = 200

setenv SUBNET2 &quot;172.18.110&quot;
let first_mgr2 = 15
let last_mgr2 = 16

setenv SUBNET3 &quot;10.0.0&quot;
let first_mgr3 = 9
let last_mgr3 = 10


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

# Delete all existing community names
setenv nextid &quot;*&quot;
setenv nextflag &quot;&quot;
arrayenv attr wfSnmpCommIndex
enumenv 1 index
:DEL_LOOP_COM:
mibget $nextflag wfSnmpCommEntry attr $nextid value nextid
if &quot;$nextid&quot; = &quot;END&quot; then; goto :DEL_LOOP_COM_EXIT:
set wfSnmpCommEntry.wfSnmpCommDelete.${value[$index]} 2
setenv nextflag &quot;-n&quot;
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 &quot;community1&quot;
set wfSnmpCommEntry.wfSnmpCommName.2 &quot;community2&quot;
set wfSnmpCommEntry.wfSnmpCommName.3 &quot;community3&quot;
# 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 &quot;*&quot;
setenv nextflag &quot;&quot;
let i = $first_mgr1
:ADD_LOOP_MGR1:
if &quot;$i&quot; > &quot;$last_mgr1&quot; 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 &quot;-n&quot;
goto :ADD_LOOP_MGR1:
:ADD_LOOP_EXIT1:
commit

# Add new managers2
setenv nextid &quot;*&quot;
setenv nextflag &quot;&quot;
let i = $first_mgr2
:ADD_LOOP_MGR2:
if &quot;$i&quot; > &quot;$last_mgr2&quot; 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 &quot;-n&quot;
goto :ADD_LOOP_MGR2:
:ADD_LOOP_EXIT2:
commit
# Add new managers3
setenv nextid &quot;*&quot;
setenv nextflag &quot;&quot;
let i = $first_mgr3
:ADD_LOOP_MGR3:
if &quot;$i&quot; > &quot;$last_mgr3&quot; 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 &quot;-n&quot;
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top