[collectd] Patch: SNMP default hostname and address

Scott Severtson ssevertson at digitalmeasures.com
Fri Jun 8 16:59:43 CEST 2012


Some metrics are readily accessible via SNMP on our hosts. However, the 
requirement to specify a hostname for the SNMP plugin requires us to 
maintain separate configuration files per host, in order to have an 
appropriate hostname set in the collected metrics.

I'd like to propose that SNMP (and other plugins that connect to a 
remote host) default to using the current host, if none is specified. 
This would allow much simpler configurations like the following to work:

              Version 2
              Community "some_community_string"
              Collect "metric_1" "metric_2" "metric_3"

I've attached a patch against 5.1.0 for snmp.c that uses "hostname_g" as 
the default host name and address when unspecified. The patch also 
supports defaults when an empty hostname is provided, such as <Host "">, 
and outputs debug information when defaults are used.

Thoughts? Concerns?

Scott Severtson
Chief Architect
Digital Measures
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snmp-default-hostname-and-address.patch
Type: text/x-patch
Size: 1522 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20120608/53d7e481/attachment.bin>

More information about the collectd mailing list