amartin-git
c19df5a77a
Set larger receive buffer size for bulk requests
...
When using SNMP BULK GET requests (from Zabbix in our case), the default value of 1024 truncates the request, resulting in malformed requests reaching the agent. Using an 8K buffer fixes this. A better approach perhaps would be to process the buffer using a loop.
2021-12-06 12:26:22 -05:00
Pim van Pelt
89abebb26b
Merge branch 'main' of github.com:pimvanpelt/vpp-snmp-agent into main
2021-09-15 08:02:26 +00:00
Pim van Pelt
18005bbbc2
Fix memory leak in logging (specifically: do not create a new logger for every SNMP PDU)
2021-09-15 07:58:08 +00:00
Pim van Pelt
a574305fb2
Reconnect faster after errors (0.1s sleep)
2021-09-15 07:57:17 +00:00
Pim van Pelt
09a2b6e9e4
Remove logger from dataset, it's not necessary, as there's only one call location that wants to say something. Turn that into an exception instead
2021-09-15 07:56:50 +00:00
Pim van Pelt
bf9d61b95d
Restart snmpd if it fails
2021-09-13 07:54:13 +02:00
Pim van Pelt
610d03a14b
Refactor README.md
2021-09-12 16:31:13 +00:00
Pim van Pelt
5051ab32ce
Update README with the -h/--help argparse hint
2021-09-12 16:22:22 +00:00
Pim van Pelt
6d0ed88722
Add argparse and a few useful arguments
...
Now that we're explicitly connecting via TCP to localhost:705 (which
can be overriden by the -a flag), we no longer need to run as root.
Therefore, update vpp-snmp-agent.service to run as user Debian-snmp
group vpp, so that /run/vpp/{api,stats}.sock are writable.
Be explicit on the commandline arguments in the service definition.
2021-09-12 16:19:33 +00:00
Pim van Pelt
7206d92f40
Move all loggers to be members of the class, not global objects
2021-09-12 16:08:35 +00:00
Pim van Pelt
9265e211e3
Swap oper/admin status (they were the wrong way around)
2021-09-12 14:09:23 +00:00
Pim van Pelt
96f2a3b4b3
Move to /usr/sbin instead of /usr/local/sbin
2021-09-11 12:55:28 +00:00
Pim van Pelt
c72890868c
s/freq/period/ to be more precies; Set default period to 30s; set wait period on reconnect to 10s; Add explicit INFO logline when replacing dataset
2021-09-11 12:45:28 +00:00
Pim van Pelt
8c9c1e2b4a
Replace the pyagentx threaded version with a much simpler, non-threaded version.
2021-09-11 12:19:38 +00:00
Pim van Pelt
842bce9d6e
Add server_address to initializer, allow for unix path (starts with /) or hostname:port address
2021-09-11 08:13:21 +00:00
Pim van Pelt
0c0e4fc14a
A better way to specify netns
...
See docs:
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#NetworkNamespacePath=
2021-09-05 21:02:11 +00:00
Pim van Pelt
184d2eceb2
Restart agent on failure
2021-09-05 20:26:47 +00:00
Pim van Pelt
9b39aa61c2
Clamp all COUNTER32 at mod 2^32
2021-09-05 20:15:06 +00:00
Pim van Pelt
7dec1329d2
Turn VPPApi into a threadsafe object
...
It now is tolerant to VPP restarts. Upon initialization, we connect(),
blocking all but the first thread from trying. The rest will see
self.connected=True and move on.
Then, on each/any error, call vpp.disconect() and set connected=False
which will make any subsequent AgentX updater run force a reconnect.
2021-09-05 20:02:11 +00:00
Pim van Pelt
e1cddc8c26
Add VPP API support to retrieve mtu/ifspeed/operstatus/adminstatus/mac
2021-09-05 19:39:20 +00:00
Pim van Pelt
238471d25f
Ensure more updates can fit in the queue, allow scaling to 20 variables on 1000 interfaces
2021-09-05 18:23:23 +00:00
Pim van Pelt
2e7aa607e4
Add most of the standard (32bit) ifTable.ifEntry MIB, the 5 that are left will require vpp_papi support, coming next
2021-09-05 18:12:02 +00:00
Pim van Pelt
ac8c323abf
Ensure VPPStat() is connected before each read; if VPP restarts, we'll lose the connection, and this ensures that once VPP comes back up, we'll re-connect to it seemlessly
2021-09-05 16:19:44 +00:00
Pim van Pelt
21f2e9dc72
format yapf
2021-09-05 16:14:11 +00:00
Pim van Pelt
7afd82c928
Remove cache, read directly and constantly from MMAP -- the update threads only fire every 10s anyway; so even a hammering snmp client won't interact with VPP more than once-per-10s
2021-09-05 16:11:23 +00:00
Pim van Pelt
80bbc754e4
Consistently clear ifstat members
2021-09-05 15:47:15 +00:00
Pim van Pelt
8256c6abfc
Update README with build/run instructions
2021-09-05 15:39:26 +00:00
Pim van Pelt
a621d560cd
Correct enumeration off-by-one; OID .14 doesn't exist
2021-09-05 15:26:13 +00:00
Pim van Pelt
954fd2e5b6
Run as root
2021-09-05 15:25:54 +00:00
Pim van Pelt
51eee915bf
initial checkin
2021-09-05 15:13:12 +00:00