snmp

SNMP: ifAdminStatus vs ifOperStatus

爷,独闯天下 提交于 2019-12-04 22:06:42
问题 I have a question about ifAdminStatus and ifOperStatus. Here is an output of my network interfaces state using ifAdminStatus: snmpwalk -Os -c public -v 1 192.168.1.1 1.3.6.1.2.1.2.2.1.7ifAdminStatus.1 = INTEGER: up(1) ifAdminStatus.12 = INTEGER: down(2) ifAdminStatus.13 = INTEGER: up(1) ifAdminStatus.14 = INTEGER: up(1) And here is the same list using ifOperStatus: snmpwalk -Os -c public -v 1 192.168.1.1 1.3.6.1.2.1.2.2.1.8 ifOperStatus.12 = INTEGER: down(2) ifOperStatus.13 = INTEGER: down(2)

Get Printer Status Using SNMP OID

£可爱£侵袭症+ 提交于 2019-12-04 21:01:42
I am working with SNMP in Android. I want to get Printer Status. I am using Snmp4Android.jar and OID 1.3.6.1.2.1.25.3.5.1.1 . Please refer this link Printer Status . SnmpActivity.java here public class SnmpActivity extends Activity { private static String ipAddress = "PrinterIP"; private static String port = "Port"; private static String oidValue = "1.3.6.1.2.1.25.3.5.1.1"; public static Snmp snmp; public static CommunityTarget comtarget; static PDU pdu; static OID oid; static VariableBinding req; Button b; private static final String tag = "SNMP CLIENT"; @Override public void onCreate(Bundle

Convert snmp octet string to human readable date format

99封情书 提交于 2019-12-04 20:09:55
问题 Using the pysnmp framework i get some values doing a snmp walk. Unfortunately for the oid 1.3.6.1.21.69.1.5.8.1.2 (DOCS-CABLE-DEVICE-MIB) i get a weird result which i cant correctly print here since it contains ascii chars like BEL ACK When doing a repr i get: OctetString('\x07\xd8\t\x17\x03\x184\x00') But the output should look like: 2008-9-23,3:24:52.0 the format is called "DateAndTime". How can i translate the OctetString output to a "human readable" date/time ? 回答1: You can find the

NET-SNMP: Getting more detail into Disman Traps

你。 提交于 2019-12-04 18:45:25
I'm working on traps using NET-SNMP and the DISMAN Event MIB With the following snmpd.conf configuration: createUser disman MD5 sercrt@1 rouser disman auth agentSecName disman #defaultMonitors yes disk / 90% disk /var 85% disk /opt 95% disk /opt/pkgs 90% disk /ufda 90% proc cron proc rtrcopy 1 1 proc socks1081 1 1 # monitor must have ".." in the line monitor -u disman -r 30 -o prNames.1 -o prErrMessage.1 "Cron not running" prErrorFlag.1 != 0 monitor -u disman -r 30 -o prNames.2 -o prErrMessage.2 "rtrcopy running" prErrorFlag.2 != 0 monitor -u disman -r 30 -o prNames.3 -o prErrMessage.3

smnp-android移植与简洁使用

故事扮演 提交于 2019-12-04 16:58:18
移植 snmp 到 Android 获取 CM mac 地址 1.linux 网络命令 dhcp 使用 Netcfg :通过串口获取 IP 地址, android 自带的命令, system/core Udhcpc :动态获取 ip ,系统内核自带。 Netcfg eth0 dhcp :动态分配 ip ,给 eth0 传递参数。 2.Snmp 源码移植和测试 case 1 )把 Snmp 源码编译成动态库 LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_C_INCLUDES := external/net-snmp/inc LOCAL_SRC_FILES:= src/snmp_client.c \ src/mib.c \ src/parse.c \ src/snmp_api.c \ src/snmp.c \ src/large_fd_set.c \ src/cert_util.c \ src/snmp_auth.c \ src/asn1.c \ src/md5.c \ src/snmp_parse_args.c \ src/system.c \ src/vacm.c \ src/int64.c \ src/read_config.c \ src/pkcs.c \ src/snmp_debug.c \ src/tools

how to load and walk a custom mib in pysnmp?

天大地大妈咪最大 提交于 2019-12-04 15:29:01
I'm new to SNMP/pysnmp and I'm trying to implement an agent that uses a custom MIB. I'm looking at the following example on the pysnmp site, but I can't seem to get it to work. Here are the steps I'm taking: convert my MIB file to a pysnmp module using build-pysnmp-mib (this succeeds without errors) set MIB source and load the MIB module using MibBuilder() use the example referenced above to set up the agent (only thing I added is the mibBuilder) use net-snmp's snmpwalk to view the loaded MIB: The snmpwalk command is: snmpwalk -v3 -u usr-md5-none -l authNoPriv -A authkey1 -E 8000000001020304

Monitoring multiple java processes on the same host via SNMP

杀马特。学长 韩版系。学妹 提交于 2019-12-04 11:57:41
I want to monitor JVM's via SNMP on Linux machine that run multiple java processes, each java process of course is independent and has different SNMP counters (num of active threads, free memory etc...),the configuration sample inside documentation assume that there is only one java process on the machine. I am searching a simple solution that my monitoring tool will ask the SNMP manager on that host without need to know port for each java process (if it will ask OID from remote machine - which java process will answer it...? how can he know...?) Thanks!!! download Java MIB file: Java MIB File

SNMPv3 to SNMPv2 glue layer

强颜欢笑 提交于 2019-12-04 11:39:40
I have been asked to install an HP OpenView agent onto a remote Unix platform to capture SNMP traps forwarded by a client application. I have since discovered that the client application can only forward SNMPv3 traps, and the agents we use can only accept SNMPv2 traps. I have discovered that I may be able to resolve this issue through the use of the Perl module NetSNMP::TrapReceiver but I am unclear how this is setup or how/if you can convert a v3 trap to a v2 trap. My goal is to capture the v3 trap and, hopefully via a script or tool, convert this to a v2 trap and send it back out on an

SNMP: Create custom OID

谁都会走 提交于 2019-12-04 06:44:28
I need custom OIDs for monitoring some of my software states. But I just can't understand: how can I create custom OID (like .1.3.6.1.4.1.30891.100.103) in Windows XP system? I need few of them to write there some info and read it when needed but I have no idea how to create them in the system. You should do this by writing an extension of Windows SNMP agent. The following article shows how, http://www.codeproject.com/KB/IP/SNMP_Agent_DLL__Part1_.aspx There are a few options to register OIDs, including: Private Enterprise Numbers (which are then publicly listed ) UUID-based OIDs In both cases,

How to get the name of the Oid (#Snmp)?

旧城冷巷雨未停 提交于 2019-12-04 06:44:17
问题 Ok, following the advice of Lex Li and I try to get Oid name using an other lib : #SnmpLib Here the sample : public static void Main(string[] args) { string oid = ".1.3.6.1.4.1"; IObjectRegistry registry = new ReloadableObjectRegistry(@"C:\Users\Fnizz\Desktop\MIBS_BARCO\"); IObjectTree tree = registry.Tree; var o = tree.Search(ObjectIdentifier.Convert(oid)); string textual = o.AlternativeText; Console.WriteLine(textual); if (o.GetRemaining().Count == 0) { Console.WriteLine(o.Definition.Type