Page MenuHomeVyOS Platform

SNMP extension script paths relative to /config/user-data do not work as expected
Closed, ResolvedPublicBUG

Description

This issue was found after upgrading from 1.3.7 to 1.4.0, even if the SNMP scripts exists in the /config/user-data directory with valid permissions, it still says script does not exist. Following error found in messages.

Jun 27 09:27:28 ht-int-gw02 snmpd[27877]: snmp-conntrack-count.sh: No such file or directory
Jun 27 09:27:28 ht-int-gw02 mp-conntrack-count.sh: No such file or directory
Jun 27 09:27:28 ht-int-gw02 snmpd[27878]: snmp-conntrack-max.sh: No such file or directory

ls -l /config/user-data:
-rwxrwxr-x 1 root vyattacfg  59 Jan 27  2023 snmp-conntrack-count.sh
-rwxrwxr-x 1 root vyattacfg  57 Jan 27  2023 snmp-conntrack-max.sh

Steps to reproduce in the lab on 1.4.0 version:

Configuration:

vyos@vyos# set service snmp script-extensions extension-name test script test.sh
[edit]
vyos@vyos# commit
[ service snmp ]

WARNING: script "test.sh" does not exist!

It works if you give full path of the script, then no warning is received:

vyos@vyos# set service snmp script-extensions extension-name test script /config/user-data/test.sh
[edit]
vyos@vyos# commit
[edit]

Details

Version
1.4.0
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

SrividyaA triaged this task as Normal priority.
dmbaturin renamed this task from SNMP: After upgrading to 1.4.0, the snmp extensions script existence is not validated properly to SNMP extension script paths relative to /config/user-data do not work as expected.Jul 18 2024, 12:05 PM
dmbaturin edited a custom field.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).
HollyGurza moved this task from Need Triage to Completed on the VyOS Rolling board.
HollyGurza moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta (1.4.0) board.