Re: Adding SNMP communities to snmp-config.xml for an ip address range

"Roskens, Ronald" <[email protected]>
Newsgroups gmane.network.opennms.general
Message-ID <B6663E208B2DA14DBB3C6FABB9207F78ABD230D7@biusmb4>
I took a quick peek at the SnmpConfigRestService.java in the opennms-webapp. It does not currently support anything other than individual ip addresses.

However, further review of the code path suggests that sending a specially crafted event to the eventbus should trigger a snmp-config.xml update. See https://github.com/OpenNMS/opennms/blob/master/opennms-config/src/main/java/org/opennms/netmgt/config/SnmpEventInfo.java

$ send-event.pl \
 --interface <first-ip-address> \
  --service SNMP \
  --parm 'PARM_FIRST_IP_ADDRESS <first-ip-address>' \
  --parm 'PARM_LAST_IP_ADDRESS <last-ip-address>' \
  --parm '...' \
uei.opennms.org/internal/configureSNMP

You'll have to look at SnmpEventInfo and EventConstants (https://github.com/OpenNMS/opennms/blob/master/features/events/api/src/main/java/org/opennms/netmgt/events/api/EventConstants.java) to see what the strings are to use for the various parameters.

Ron

From: JohnD Blackburn [mailto:[email protected]]
Sent: Monday, February 05, 2018 9:54 PM
To: General OpenNMS Discussion
Subject: Re: [opennms-discuss] Adding SNMP communities to snmp-config.xml for an ip address range

*Bump*

Does anyone have any ideas on this?

Regards,
John








From: JohnD Blackburn [mailto:[email protected]]
Sent: Wednesday, 31 January 2018 7:02 AM
To: General OpenNMS Discussion <[email protected]<mailto:[email protected]>>
Subject: [opennms-discuss] Adding SNMP communities to snmp-config.xml for an ip address range

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I'm trying to set up an automated script for adding an snmp community to the snmp-config.xml file  for an ip address range.

I've found I can update/add an snmp community for an individual ip address using provision.pl, but I'd like to be able to do the same for an ip address range.

I know I could do this by directly editing the snmp-config.xml file or the web interface, but I'd prefer to use a standard OpenNMS api/commandline interface to perform this operation if possible.


How do I perform an add/update of an snmp community string for an ip address range from the commandline?

I'm running OpenNMS 21.0.2

Regards,
John Blackburn

----------------------------------------------------------------------
This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.