Dzahn has submitted this change and it was merged.

Change subject: add :0 as port when sending outgoing SNMP requests
......................................................................


add :0 as port when sending outgoing SNMP requests

so that non-root users can bind to it and we avoid getting
SNMP permission denied errors when icinga
runs these.

we send the client IP since I9c7b1c11aeef2ff984ab25c7c81514be3c5897db

this fixes lots of Icinga monitors with status UNKNOWN

https://icinga.wikimedia.org/cgi-bin/icinga/status.cgi?host=all&type=detail&servicestatustypes=8&hoststatustypes=3&serviceprops=2097162&nostatusheader

if snmp.conf just has the IP:  clientaddr 208.80.154.14

root@neon:~# sudo -u nagios /usr/lib/nagios/plugins/check_snmp -H 10.65.0.42 -C 
...
External command error: snmpget: Unknown host (10.65.0.42:161) (Permission 
denied)

if snmp.conf also has port :0

root@neon:~# sudo -u nagios /usr/lib/nagios/plugins/check_snmp -H 10.65.0.42 -C 
...
SNMP OK - ps1-b3-eqiad-infeed-load-tower-A-phase-X 750 | 
ps1-b3-eqiad-infeed-load-tower-A-phase-X=750

Change-Id: I2e8b31459e78e5fd743cc817faeab82971aa1e26
---
M modules/base/templates/snmp.conf.erb
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/base/templates/snmp.conf.erb 
b/modules/base/templates/snmp.conf.erb
index a91102c..0d6d6e1 100644
--- a/modules/base/templates/snmp.conf.erb
+++ b/modules/base/templates/snmp.conf.erb
@@ -4,9 +4,9 @@
 ######################################################################
 mibs :
 <% if has_variable?('::ipaddress_bond0') then %>
-clientaddr <%= scope.lookupvar('::ipaddress_bond0') %>
+clientaddr <%= scope.lookupvar('::ipaddress_bond0') %>:0
 <% elsif has_variable?('::ipaddress_eth0') then %>
-clientaddr <%= scope.lookupvar('::ipaddress_eth0') %>
+clientaddr <%= scope.lookupvar('::ipaddress_eth0') %>:0
 <% else %>
-clientaddr <%= scope.lookupvar('::ipaddress') %>
+clientaddr <%= scope.lookupvar('::ipaddress') %>:0
 <% end %>

-- 
To view, visit https://gerrit.wikimedia.org/r/86834
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e8b31459e78e5fd743cc817faeab82971aa1e26
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: ArielGlenn <ar...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to