3

I'm using Ubuntu 16.04. I've changed snmpd.conf for listening to unix socket instead of its default udp port 161, but snmpget fails with Timeout error.

Before changing the config file this was working:

snmpget -v2c -c public localhost SNMPv2-MIB::sysUpTime.0

with an output like this:

SNMPv2-MIB::sysUpTime.0 = Timeticks: (1453) 0:00:14.53

Then I changed agentAddress in the config file like below:

agentAddress unix:/tmp/snmp/agent.sock

And restarted snmpd service. Now when I use snmpget like this:

snmpget -v2c -c public unix:/tmp/snmp/agent.sock SNMPv2-MIB::sysUpTime.0

It errors:

Timeout: No Response from unix:/tmp/snmp/agent.sock.

In snmpd man page it said that listening address could be changed to unix socket but it seems not working.

  • @sorosh_sabz Why? That has nothing to do with the question. If you have a question about the performance impact of UNIX Sockets (as compared to some other thing, in some particular circumstance) then you should ask a new question, clearly and with all required detail. – Lightness Races in Orbit Aug 03 '19 at 18:48
  • @LightnessRacesinOrbit your right, but I have an [question about this clearly](https://stackoverflow.com/q/56822296/1539100) and does get any satisfiable answer about that, so I hope someone answer this in another related question :) – sorosh_sabz Aug 07 '19 at 03:05
  • @LightnessRacesinOrbit anyway I deleted my comment :) – sorosh_sabz Aug 07 '19 at 03:29
  • Don't spam other people's questions to get answers to your own, unrelated questions. Thanks – Lightness Races in Orbit Aug 07 '19 at 14:32

1 Answers1

0

You need to use the -x option, as indicated in the nam page you sited.

Andrew
  • 1
  • 4
  • 19