Здраствуйте. Система Ubuntu 9.04.
У меня не получается добавить скрипт в конфиг snmpd. Вро де бы все делал как там написано:###############################################################################
# Extensible sections.
#
# This alleviates the multiple line output problem found in the
# previous executable mib by placing each mib in its own mib table:
# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note: this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do. Uncomment to use it.
#
# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
exec .1.3.6.1.4.1.2021.50 test /bin/sh /opt/test.sh
# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0
# Now the Output has grown to two lines, and we can see the 'hi
# there.' output as the second line from our shell script.
#
# Note that you must alter the mib.txt file to be correct if you want
# the .50.* outputs above to change to reasonable text descriptions.
но по запросу snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
ничего не выводится. Прямо не знаю, что за напасть то такая. Сам скрипт нормально выполняется. В настройках все что можно помоему разрешил.
Что самое мне не понятное это что на работе на шапочке все работает, а дома на убунте не хотит.
Я в тупике, подскажите где выход?
[attachment=270:snmpd.txt]
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
Решение нашёл.
Оказывается, начиная с какой-то версии snmpd, в конфигурационном файле для выполнения внешних скриптов надо писать не "exec" или "pass", а "extend". Сразу всё заработало.