Menu

#2911 snmpd file logging level does not work

debian
invalid
nobody
5
2019-01-21
2019-01-15
mabra
No

Hello!

Using

snmpd -f -LSwd -LFi /var/log/snmp/snmpd.log< (or: -LF6)
does not produce an outputfile at all, while
snmpd -f -LSwd -Lf /var/log/snmp/snmpd.log
does.
According to the documentation it should.
Staying with "-Lf" just give no information about the level/severity of logentries.
The same mechanisme works well with syslog.

This is
NET-SNMP version: 5.7.3 on debian stretch (4.17.0-0.bpo.1-amd64)

Regards,
Manfred

Discussion

  • Anders Wallin

    Anders Wallin - 2019-01-18

    You need to use spaces between LF and i, or no spaces between i and the filename
    "-LF<space>i<space>/var/log/snmp/snmpd.log"
    or
    "-LFi/var/log/snmp/snmpd.log" </space></space>

    According to the doc you should use spaces
    
    snmpd -h
    ....
       -L <LOGOPTS>          toggle options controlling where to log to
            e:           log to standard error
            o:           log to standard output
            n:           don't log at all
            f file:      log to the specified file
            s facility:  log to syslog (via the specified facility)
    
            (variants)
            [EON] pri:   log to standard error, output or /dev/null for level 'pri' and above
            [EON] p1-p2: log to standard error, output or /dev/null for levels 'p1' to 'p2'
            [FS] pri token:    log to file/syslog for level 'pri' and above
            [FS] p1-p2 token:  log to file/syslog for levels 'p1' to 'p2'
    ....
    
     

    Last edit: Anders Wallin 2019-01-18
  • Bart Van Assche

    Bart Van Assche - 2019-01-21
    • status: open --> invalid
     

Log in to post a comment.