[AGENT++] AgentX++ suagent commiterror let the RowStatus in detroy(6); the row is block forever!
Claus Klein
claus.klein at arcormail.de
Fri Oct 29 22:59:39 CEST 2010
Hi Frank,
I have found a third issue about the RowStatus handling at the subagent.
With this script, you can force this error as many times you want,
simple choose a new row index.
Kindly regards,
Claus
P.S.: You need a bash and net-snmp tools too ;-)
------------------------------------------------------------------
#!/bin/sh
set -u # undefined var is an error
#XXX#
set -e # exit on error
##################################################################################
# usage: start the agentX master agent and than the subagent2 first! ck
##################################################################################
SNMP_ARGS='-v3 -r0 -uunsecureUser localhost:4700 '
SNMP_ROW_INDEX=1
printf "\n#Setup\n"
set -x # be verbose
snmpset ${SNMP_ARGS} \
AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.$
{SNMP_ROW_INDEX} = destroy \
#XXX# AGENTPP-TEST-MIB::agentppTestRowCreation.1 = ${SNMP_ROW_INDEX}
printf "\n#Pre-condition: row must not exist!\n"
snmpget ${SNMP_ARGS} \
AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.$
{SNMP_ROW_INDEX} |
grep -v -q 'No Such Instance' && snmpset ${SNMP_ARGS} \
AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.$
{SNMP_ROW_INDEX} = destroy
printf "\n#Test case: create non-existing table with RowStatus as
single shot\n"
snmpset ${SNMP_ARGS} \
AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.$
{SNMP_ROW_INDEX} = createAndGo \
AGENTPP-TEST-MIB::agentppTestSharedTableDelay.${SNMP_ROW_INDEX} =
13 \
AGENTPP-TEST-MIB::agentppTestTimeout.0 = 13 \
#FIXME: AgentX++ suagent commiterror let the RowStatus in detroy(6);
the row is block forever!
printf "\n#Post-condition: row must exist and in state active!\n"
snmptable -C biw 100 ${SNMP_ARGS} AGENTPP-TEST-
MIB::agentppTestSharedTable
printf "\n#Cleanup\n"
snmpset ${SNMP_ARGS} \
AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.$
{SNMP_ROW_INDEX} = destroy
exit
##################################################################################
# #Setup
# + snmpset -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestSharedTableRowStatus.1 = destroy
# AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.1 = INTEGER:
destroy(6)
# + printf '\n#Pre-condition: row must not exist!\n'
#
# #Pre-condition: row must not exist!
# + snmpget -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestSharedTableRowStatus.1
# + grep -v -q 'No Such Instance'
# + snmpset -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestSharedTableRowStatus.1 = destroy
# Error in packet.
# Reason: inconsistentValue (The set value is illegal or unsupported
in some way)
# Failed object: AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.1
#
# + printf '\n#Test case: create non-existing table with RowStatus as
single shot\n'
#
# #Test case: create non-existing table with RowStatus as single shot
# + snmpset -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestSharedTableRowStatus.1 = createAndGo AGENTPP-TEST-
MIB::agentppTestSharedTableDelay.1 = 13 AGENTPP-TEST-
MIB::agentppTestTimeout.0 = 13
# Error in packet.
# Reason: inconsistentValue (The set value is illegal or unsupported
in some way)
# Failed object: AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.1
#
# + printf '\n#Post-condition: row must exist and in state active!\n'
#
# #Post-condition: row must exist and in state active!
# + snmptable -C biw 100 -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-
TEST-MIB::agentppTestSharedTable
# SNMP table: AGENTPP-TEST-MIB::agentppTestSharedTable
#
# index CreationTime Delay Session RowStatus
# 1 2010-10-29,22:11:33.0,+1:0 0 1/100 seconds. 2 destroy
# + printf '\n#Cleanup\n'
#
# #Cleanup
# + snmpset -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestSharedTableRowStatus.1 = destroy
# Error in packet.
# Reason: inconsistentValue (The set value is illegal or unsupported
in some way)
# Failed object: AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.1
# 20101029.22:29:51: 43850: (5)INFO : AgentXSlave: no request within
(milli seconds): (40000)
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (242),
(367), (1), (8), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: TESTSET (tid)
(pid)(oid)...: (242), (367), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Agent: preparing set request:
(242)
# 20101029.22:29:53: 43850: (3)EVENT : RequestList: finished
subrequest (ind): (0)
# 20101029.22:29:53: 43850: (3)EVENT : AgentX: sending agentx pdu
(context)(flags)(sd)(type)(sid)(tid)(pid)(err)(errind): (), (0), (3),
(18), (2), (242), (367), (0), (0)
# 20101029.22:29:53: 43850: (4)EVENT : RequestListAgentX: request
answered (id)(status)(tid)(err)(removed)(sz): (242), (0), (242), (0),
(0), (1)
# 20101029.22:29:53: 43850: (2)EVENT : Agent: finished thread execution
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (242),
(368), (0), (9), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: COMMITSET (tid)
(pid)(oid)...: (242), (368), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Agent: committing set request:
(242)
############################################################################
# 20101029.22:29:53: 43850: (2)DEBUG : AgentXSlave: sending register
PDU (context)(oid)(rangeid)(upper): (),
(1.3.6.1.4.1.4976.6.3.1.3.1.2.2), (13), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : AgentX: sending agentx pdu
(context)(flags)(sd)(type)(sid)(tid)(pid)(err)(errind): (), (0), (3),
(3), (2), (120), (122), (0), (0)
# 20101029.22:29:53: 43850: (3)EVENT : RequestList: finished
subrequest (ind)(oid)(val)(syn): (0),
(1.3.6.1.4.1.4976.6.3.1.3.1.5.2), (6), (2)
# 20101029.22:29:53: 43850: (3)EVENT : AgentX: sending agentx pdu
(context)(flags)(sd)(type)(sid)(tid)(pid)(err)(errind): (), (0), (3),
(18), (2), (242), (368), (0), (0)
# 20101029.22:29:53: 43850: (4)EVENT : RequestListAgentX: request
answered (id)(status)(tid)(err)(removed)(sz): (242), (0), (242), (0),
(0), (1)
# 20101029.22:29:53: 43850: (2)EVENT : Agent: finished thread execution
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (120),
(122), (0), (18), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (242),
(369), (0), (11), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : Agent: finished thread execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (1)DEBUG : SubAgentXMib: registration
success (oid): (1.3.6.1.4.1.4976.6.3.1.3.1.2.2)
############################################################################
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: CLEANUPSET (tid)
(pid)(oid)...: (242), (369), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Agent: cleaning up set
request: (242)
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (243),
(370), (0), (5), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: GET (tid)(pid)
(oid)...: (243), (370), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Mib: process subrequest: get
request, oid: (243), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : RequestList: finished
subrequest (ind)(oid)(val)(syn): (0),
(1.3.6.1.4.1.4976.6.3.1.3.1.5.2), (6), (2)
# 20101029.22:29:53: 43850: (3)EVENT : AgentX: sending agentx pdu
(context)(flags)(sd)(type)(sid)(tid)(pid)(err)(errind): (), (0), (3),
(18), (2), (243), (370), (0), (0)
# 20101029.22:29:53: 43850: (4)EVENT : RequestListAgentX: request
answered (id)(status)(tid)(err)(removed)(sz): (243), (0), (243), (0),
(1), (1)
# 20101029.22:29:53: 43850: (2)EVENT : Agent: finished thread execution
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (244),
(371), (1), (8), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: TESTSET (tid)
(pid)(oid)...: (244), (371), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Agent: preparing set request:
(244)
# 20101029.22:29:53: 43850: (3)EVENT : AgentX: sending agentx pdu
(context)(flags)(sd)(type)(sid)(tid)(pid)(err)(errind): (), (0), (3),
(18), (2), (244), (371), (12), (1)
# 20101029.22:29:53: 43850: (4)EVENT : RequestListAgentX: request
answered (id)(status)(tid)(err)(removed)(sz): (244), (0), (244), (12),
(0), (1)
# 20101029.22:29:53: 43850: (2)EVENT : Agent: finished thread execution
# 20101029.22:29:53: 43850: (4)DEBUG : AgentXSlave: received
something on ports
# 20101029.22:29:53: 43850: (2)EVENT : AgentXRequestList: request
received (context)(tid)(pid)(siz)(type)(err)(status): (), (244),
(372), (0), (11), (0), (0)
# 20101029.22:29:53: 43850: (1)DEBUG : TaskManager: task manager found
# 20101029.22:29:53: 43850: (2)DEBUG : TaskManager: after notify
# 20101029.22:29:53: 43850: (2)EVENT : SubAgent: starting thread
execution
# 20101029.22:29:53: 43850: (2)EVENT : SubAgentXMib: CLEANUPSET (tid)
(pid)(oid)...: (244), (372), (1.3.6.1.4.1.4976.6.3.1.3.1.5.2)
# 20101029.22:29:53: 43850: (3)EVENT : Agent: cleaning up set
request: (244)
# 20101029.22:30:33: 43850: (5)INFO : AgentXSlave: no request within
(milli seconds): (40000)
# snmpwalk -v3 -r0 -uunsecureUser localhost:4700 AGENTPP-TEST-
MIB::agentppTestObjects
# AGENTPP-TEST-MIB::agentppTestTimeout.0 = Gauge32: 13 1/1000 seconds.
# AGENTPP-TEST-MIB::agentppTestSharedTableCreationTime.1 = STRING:
2010-10-29,22:11:33.0,+1:0
# AGENTPP-TEST-MIB::agentppTestSharedTableCreationTime.2 = STRING:
2010-10-29,22:11:33.0,+1:0
# AGENTPP-TEST-MIB::agentppTestSharedTableDelay.1 = INTEGER: 0 1/100
seconds.
# AGENTPP-TEST-MIB::agentppTestSharedTableDelay.2 = INTEGER: 0 1/100
seconds.
# AGENTPP-TEST-MIB::agentppTestSharedTableSession.1 = Gauge32: 2
# AGENTPP-TEST-MIB::agentppTestSharedTableSession.2 = Gauge32: 2
# AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.1 = INTEGER:
destroy(6)
# AGENTPP-TEST-MIB::agentppTestSharedTableRowStatus.2 = INTEGER:
destroy(6)
# AGENTPP-TEST-MIB::agentppTestRowCreation.2 = Gauge32: 0
#############################
# APENDIX: my net-snmp config file:
#############################
claus-kleins-macbook-pro:~ clausklein$ cat .snmp/snmp.conf
#---------------------------------------------------------------------------------
defVersion v2c
defCommunity public
defSecurityLevel noAuthNoPriv
###default: /usr/share/snmp/mibs
mibdirs +/Users/clausklein/.snmp/mibs:/opt/local/share/mibs/ietf:/opt/
local/share/mibs/iana
mibdirs +/Users/clausklein/Workspace/cpp/AgentPro/agent++/mibs
### mibs ALL
mibs +LLDP-MIB
mibs +NOTIFICATION-LOG-MIB
mibs +NET-SNMP-MIB
mibs +NET-SNMP-AGENT-MIB
mibs +AGENTX-MIB
mibs +AGENTPP-SIMULATION-MIB
mibs +AGENTPP-GLOBAL-REG
mibs +AGENTPP-TEST-MIB
#-------------------------------------------------------------------------------------
More information about the AGENTPP
mailing list