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.
This commit is contained in:
Pim van Pelt
2021-09-12 16:17:23 +00:00
parent 7206d92f40
commit 6d0ed88722
2 changed files with 21 additions and 3 deletions

View File

@ -6,7 +6,8 @@ ConditionPathExists=/etc/snmp/snmpd.conf
[Service]
Type=simple
NetworkNamespacePath=/var/run/netns/dataplane
ExecStart=/usr/sbin/vpp-snmp-agent
ExecStart=/usr/sbin/vpp-snmp-agent -a localhost:705 -p 30
User=Debian-snmp
Group=vpp
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure