Bug 153758 - snmpd exec not returning output
snmpd exec not returning output
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-05 13:48 EDT by Steve Cleveland
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-09 05:13:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve Cleveland 2005-04-05 13:48:05 EDT
Description of problem:

Using the 'exec' keyword, you can run custom scripts and have the output
available in snmp queries.  However, after upgrading to rhel4 (from rhel3), I no
longer get the ouput.

Version-Release number of selected component (if applicable):

net-snmp-5.1.2-11

How reproducible:

Every time

Steps to Reproduce:

1. Create a simple shell script.
    #!/bin/csh
    echo "Test";
2. Save it to /usr/bin/mytest.  chmod a+x. Make sure you can run it manually.
3. Add this line to /etc/snmp/snmpd.conf:
    exec testing /usr/bin/mytest
4. Restart snmpd service
5. Run an snmp query:
    snmpwalk -v 2c -c <community> <host> 1.3.6.1.4.1.2021.8
  
Actual results:

UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
UCD-SNMP-MIB::extNames.1 = STRING: testing
UCD-SNMP-MIB::extCommand.1 = STRING: /usr/bin/mytest
UCD-SNMP-MIB::extResult.1 = INTEGER: 1
UCD-SNMP-MIB::extOutput.1 = STRING:
UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::extErrFixCmd.1 = STRING:

Expected results:

UCD-SNMP-MIB::extOutput.1 = STRING: Test

Additional info:

This also occurs with custom OID's.  With custom OID's, the extOutput entry
(.101.1) doesn't even show up.
Comment 1 Steve Cleveland 2005-04-22 11:47:18 EDT
It turned out to be SELinux not allowing snmpd to execute anything.  Changing
selinux to permissive allowed snmp to work as expected.  Now I just need to read
up on selinux and figure out how to get them to work together.
Comment 2 Radek Vokal 2005-05-09 05:13:01 EDT
Yep, works same for me. SELinux retrains the output of the script so this only
needs SELinux audit tune-up. 

Note You need to log in before you can comment on or make changes to this bug.