Is it possible to set SNMP trap/notification target though SNMP? - snmp

Can I configure trap/notification targets by setting some OID values by sending SNMP SetRequest PDU's ?

If the agent implements it, the standard mechanisms are provided by SNMP-TARGET-MIB (RFC 3413), SNMP-NOTIFICATION-MIB (also RFC 3413), and (if SNMPv1 or SNMPv2c) SNMP-COMMUNITY-MIB (RFC 3584).

Related

Can I use SNMP to discovery devices if I dont have LA

I am trying to discover some Windows and Linux machines that are provided by a 3rd part vendor so I dont have Local Admin access.
Providing I have the community string can discover these devices and find information like OS, HDD utilization, machine name?
Kind Regards,
Warren Gardner
The typical SNMP discovery is simply a number of SNMP GET/GET-NEXT requests to query the list of predefined OIDs. The procedure scans the range of IP addresses (UDP port 161) using the same SNMP security parameters. For SNMP v1/v2C the only parameter you need to specify is Read Community string. For SNMPv3 you have to specify security level, auth/priv protocol, username and password and some other parameters.
Please note that there is no standard for SNMP discovery. So usually the results of discovery are very limited (subset of RFC1213 - MIB-2):
sysName,
sysDescr,
sysLocation
network interfaces
The advanced SNMP discovery procedure is usually implemented in commercial software/NMS and includes extended information from Cisco IOS, printer status (toner level and so on), etc. Also these systems are capable of doing topology discovery based on CDP, LLDP, routing tables.

How to set Peer Address in SNMP4J library before sending traps?

I am receiving traps from the device and want to forward it. Before forwarding I want to set peer address of the source system.
Your SNMP manager could for example add the variable binding snmpTrapAddress.0 to the trap, setting its value to the address of the originating host.
But this is a bit of a hack. If you're writing custom software just to forward traps, I'd suggest that you're reinventing the whell. Consider instead installing net-snmp and letting it forward the traps for you.

How to assign an SNMPv2c inform request from another manager to the proper agent?

The SNMPv2c specification states that "An InformRequest-PDU is generated and transmitted at the request of an application in a SNMPv2 entity acting in a manager role..." [RFC 1905, section 4.2.7]
If a manager receives an inform request from another manager, I wonder how it assigns the data to the proper agent.
When the inform request is received from an agent - like a trap - the IP address can be used to assign the data to the agent.
This case also seems to make more sense to me. Are there any real world applications where an inform is sent by a manager?
You can not change the IP address in INFORM PDU. This type of SNMP PDU does not have such field. So the receiver always uses src_ip of UDP datagram. The Agent Address is part of TrapV1 PDU only.

Significance of context name in snmpv3

Snmpv3 is a secured protocol compared to Snmpv2 and Snmpv1. But I dont understand what is the use of context name.We already have an user name and also authentication and privacy passwords which provide a security level. Someone using a wireshark cannot identify it as it is sent through encrypted form. So what is the use of context name in Snmpv3?
The contextName and contextEngineID parameters allow multiple versions of the same MIB objects to be made available by a single SNMPv3 engine, as if you have multiple agents running on the same IP address and port. These are distinguished from one another by contextName and contextEngineID, where otherwise they would have had a different address and/or port. One reason for this could be that you have a master agent with multiple sub-agents and the sub-agents have some overlap. Another reason would be a proxy agent: for example, a manager that only speaks SNMPv3 and devices than only speak SNMPv1 could use a multi-lingual proxy at a single address/port and use the contextName and contextEngineID to identify devices. The proxy here would map the contextName and contextEngineID to device address/port and translate/forward requests to the devices and responses back to the manager.

How Free Switch Profiles and Bridges work

What is the meaning of internal profile or external profile in Free Switch?
Also I don't know the meaning of -
application="bridge".
I also cannot understand
data="${sofia_contact($${gwuser}#$${domain})}"
or
data="sofia/internal/${destnumber}#192.168.10.33:5062"
It will be really helpful if someone could give me a proper explanation, or at least, point me to a right direction.
"internal" and "external" are names of sip profiles. Those are usually defined in the default configuration of freeswitch. They are sample configurations optimized for internal or external access, you can define other sip profiles with a configuration according to your needs.
application="bridge" is an application that bridges an incoming call to an other external or internal destination.
data="sofia/internal/${destnumber}#192.168.10.33:5062" means you want to use the sofia sipstack, the sip profile with the name "internal" with the content of the variable "destnumber" to ip 192.168.10.3 on port 5062.
Application bridge connects two channels(end-points) together.
sofia_* is the open source SIP protocol implementation developed by Nokia guys.
So, $${gwuser} is variable which contains the name of the user to call in SIP address notation: name#domain.
${domain} is the domain name.
sofia/internal/<adress> means that will be used internal sip number which is handled by local freeswitch PBX.
I think you should clarify a bit how freeswitch (mod_sofia) consider locally registered endpoints vs gateways:
http://wiki.freeswitch.org/wiki/Mod_sofia

Resources