Re: snmptrapd -A append not working

"Ben Carbery" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
OPTIONS="-c /etc/snmp/snmptrapd.conf -A -Lf /var/snmp/snmptrapd.log -p
/var/run/snmptrapd.pid"

This still does not work. Note the -A is missing from the output:

[root@server archive]# service snmptrapd restart
Stopping snmptrapd:                                        [  OK  ]
Starting snmptrapd: /usr/sbin/snmptrapd: invalid option -- A
invalid option: -?
Usage: snmptrapd [OPTIONS] [LISTENING ADDRESSES]

        NET-SNMP Version:  5.3.1
        Web:      http://www.net-snmp.org/
        Email:    [email protected]

  -a                    ignore authentication failure traps
  -c FILE               read FILE as a configuration file
  -C                    do not read the default configuration files
  -d                    dump sent and received SNMP packets
  -D                    turn on debugging output
  -e                    print event # (rising/falling alarm, etc.)
  -f                    do not fork from the shell
  -F FORMAT             use specified format for logging to standard error
  -h, --help            display this usage message
  -H                    display configuration file directives understood
  -m MIBLIST            use MIBLIST instead of the default MIB list
  -M DIRLIST            use DIRLIST as the list of locations
                          to look for MIBs
  -n                    use numeric addresses instead of attempting
                          hostname lookups (no DNS)
  -p FILE               store process id in FILE
  -t                    Prevent traps from being logged to syslog
  -v, --version         display version information
  -x ADDRESS            use ADDRESS as AgentX address
  -O <OUTOPTS>          toggle options controlling output display
                        0:  print leading 0 for single-digit hex characters
                        a:  print all strings in ascii format
                        b:  do not break OID indexes down
                        e:  print enums numerically
                        E:  escape quotes in string indices
                        f:  print full OIDs on output
                        n:  print OIDs numerically
                        q:  quick print for easier parsing
                        Q:  quick print with equal-signs
                        s:  print only last symbolic element of OID
                        S:  print MIB module-id plus last element
                        t:  print timeticks unparsed as numeric integers
                        T:  print human-readable text along with hex strings
                        u:  print OIDs using UCD-style prefix suppression
                        U:  don't print units
                        v:  print values only (not OID = value)
                        x:  print all strings in hex format
                        X:  extended index format
  -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'

  Deprecated options:
  -o FILE               use -Lf <FILE> instead
  -P                    use -f -Le  instead
  -s                    use -Lsd instead
  -S d|i|0-7            use -Ls <facility> instead
  -u FILE               use -p <FILE> instead



On Nov 27, 2007 8:50 PM, Dave Shield <[email protected]> wrote:
> On 27/11/2007, Ben Carbery <[email protected]> wrote:
> >  The man page indicates -A should cause traps to be appended to the
> >  file, but adding this option cause the service to fail.
> >
> >  e.g.
> >  OPTIONS="-c /etc/snmp/snmptrapd.conf -LAf /var/snmp/snmptrapd.log
> >      -p /var/run/snmptrapd.pid"
>
> No - that won't work.
> -A is an option in its own right - it's not a sub-option of the -L flag.
>
> >  or
> >  OPTIONS="-c /etc/snmp/snmptrapd.conf -Lf /var/snmp/snmptrapd.log -A
> >     -p  /var/run/snmptrapd.pid"
>
> Hmmm.... I would have expected that to work....
>
> >  The -H output seems to omit append as a supported option.
>
> -H just lists the snmptrapd.conf directives.
> It doesn't list the command-line options.  Use '-h' for that.
>
>
>
> >  Is it the case that this option is no longer supported?
>
> No.  It *is* supported, but you're discovered a problem
> with the implementation.
>
> The -A option sets an internal flag to control whether
> log files should be truncated or appended to.
> The -Lf option looks at this flag when it's opening the
> specified log file, and acts accordingly.
>
> But it works using the value of this internal flag at
> the time that the -Lf option is parsed - which in this
> case is *before* the -A option is processed.
>
> Try
> >  OPTIONS="-c /etc/snmp/snmptrapd.conf -A  -Lf /var/snmp/snmptrapd.log
> >     -p  /var/run/snmptrapd.pid"
>
> I'll update the documentation to mention this.
>
> Dave
>



-- 
 -------------------------------------------------------------------------------------------------------------------------------------------------------
"Because it that the times revive as time is fresh somehow, and it to
feel wins why, and, as for it, all forget an old thing" - Japanese
saying

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.