t110agentxget

来自「snmp up7」· 代码 · 共 55 行

TXT
55
字号
#!/bin/sh. ../eval_tools.shHEADER AgentX GET supportSKIPIFNOT USING_AGENTX_MODULESKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE## Begin test## standard V3 configuration for initial user. ./Sv3config# Start the agent without initializing the system mib.ORIG_AGENT_FLAGS="$AGENT_FLAGS -x $SNMP_TMPDIR/agentx_socket"AGENT_FLAGS="$ORIG_AGENT_FLAGS -I -system_mib"STARTAGENT# test to see that the current agent doesn't support the system mibCAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"CHECK ".1.3.6.1.2.1.1.3.0 = No Such Object"if test "$snmp_last_test_result" = 1; then  # test the agentx subagent by first running it...  SNMP_SNMPD_PID_FILE_ORIG=$SNMP_SNMPD_PID_FILE  SNMP_SNMPD_LOG_FILE_ORIG=$SNMP_SNMPD_LOG_FILE  SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE.num2  SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE.num2  AGENT_FLAGS="$ORIG_AGENT_FLAGS -X -I system_mib"  SNMP_CONFIG_FILE="$SNMP_TMPDIR/bogus.conf"  STARTAGENT  # test to see that the agent now supports setting the system mib  CAPTURE "snmpget -On $SNMP_FLAGS -t 3 -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"  CHECK ".1.3.6.1.2.1.1.3.0 = Timeticks:"  # stop the subagent  STOPAGENT  SNMP_SNMPD_PID_FILE=$SNMP_SNMPD_PID_FILE_ORIG  SNMP_SNMPD_LOG_FILE=$SNMP_SNMPD_LOG_FILE_ORIGfi# stop the master agentSTOPAGENT# all done (whew)FINISHED

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?