Bug 825623 - libvirt-snmp can use both -DTOKEN and -D TOKEN, man doc and libvirtMib_subagent help page are wrong.
libvirt-snmp can use both -DTOKEN and -D TOKEN, man doc and libvirtMib_subage...
Status: NEW
Product: Virtualization Tools
Classification: Community
Component: libvirt-snmp (Show other bugs)
unspecified
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Michal Privoznik
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-28 01:16 EDT by zhpeng
Modified: 2016-04-18 20:43 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
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 zhpeng 2012-05-28 01:16:19 EDT
Description of problem:
libvirt-snmp can use both -DTOKEN and -D TOKEN, man doc and libvirtMib_subagent help page are wrong.
libvirtMib_subagent should support -h or --help, and help page format is wrong

Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6
libvirt-snmp-0.0.2-3.el6.x86_64
net-snmp-5.5-41.el6.x86_64

How reproducible:
always

Steps to Reproduce:
# man libvirtMib_subagent
-D[token[,...]]                          --------------> need update
           Turn on debugging output for the given TOKEN(s).  Without any
           tokens specified, it defaults to printing all the tokens (which
           is equivalent to the keyword ’"ALL"’).  You might want to try
           ALL for extremely verbose output.  Note: You can’t put a space   --------> both two ways are supported
           between the -D and the tokens.

[root@zhpeng ~]# libvirtMib_subagent -h
libvirtMib_subagent: invalid option -- 'h'      ------------> libvirtMib_subagent should support -h or --help
unknown option ?
usage: libvirtGuestTable [-D<tokens>] [-f] [-L] [-M] [-H] [LISTENING ADDRESSES]
        -f      Do not fork() from the calling shell.
        -DTOKEN[,TOKEN,...]                    -------------need update
                Turn on debugging output for the given TOKEN(s).
                Without any tokens specified, it defaults to printing
                all the tokens (which is equivalent to the keyword 'ALL').
                You might want to try ALL for extremely verbose output.
                Note: You can't put a space between the -D and the TOKENs.       ---------> need update
        -H        Display a list of configuration file directives
                understood by the agent and then exit.
        -M        Run as a normal SNMP Agent instead of an AgentX sub-agent.
        -x ADDRESS        connect to master agent at ADDRESS (default /var/agentx/master).   -------> wrong format
        -L        Do not open a log file; print all messages to stderr.


-D option test:
yum install autoconf automake gcc rpm-build
yum install net-snmp-perl net-snmp net-snmp-utils net-snmp-devel libvirt-deve
yum install libvirt-snmp

1. prepare /etc/snmp/snmpd.conf as follows:
# cat /etc/snmp/snmpd.conf
rwcommunity public
master agentx
trapcommunity public
trap2sink  localhost

2. append the following lines to /etc/snmp/snmptrapd.conf
# Example configuration file for snmptrapd
authCommunity log,execute,net public
logOption f /var/log/snmptraps.log

3. add the following lines to /etc/sysconfig/snmptrapd:
OPTIONS="-m ALL -p /var/run/snmptrapd.pid"

4. restart snmpd and snmptrapd service

# service snmpd restart
# service snmptrapd restart

5. run libvirt snmp agent daemon
# LIBVIRT_DEFAULT_URI="qemu:///system" libvirtMib_subagent -f -L -Dtrace,9 >> aaa 2>&1
# LIBVIRT_DEFAULT_URI="qemu:///system" libvirtMib_subagent -f -L -D trace,9 >> bbb 2>&1

both works, the output files are the same.

Actual results:
1,-h or --help not support
2, wrong format of help page
3, man page need update

Expected results:
As steps

Additional info:
Comment 2 Petr Pisar 2012-05-28 04:38:03 EDT
This has nothing to do with Perl. This is libvirt or net-snmp issue. Reassigning to libvirt-snmp maintainer.
Comment 4 RHEL Product and Program Management 2012-09-07 01:16:11 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 7 Hu Jianwei 2014-06-04 23:27:12 EDT
Another wrong display in usage.

Version:
libvirt-snmp-0.0.2-4.el6.x86_64
libvirt-0.10.2-37.el6.x86_64

[root@rhel6 src]# libvirtMib_subagent -p
libvirtMib_subagent: invalid option -- 'p'
unknown option ?
usage: libvirtGuestTable [-D<tokens>] [-f] [-L] [-M] [-H] [LISTENING ADDRESSES]
...

Actual results:
As shown above step.

Expected results:
I think libvirtMib_subagent should instead of libvirtGuestTable because we have no libvirtGuestTable command in user layer. Although it is a minor issue, we'd better fix it.

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