Using NET-SNMP and HP-UX SNMP together

Why would one want to do such a thing? A major reason is that the HP-UX SNMP daemon only supports the EMANATE protocol for subagents; this means that subagents that support the AgentX protocol (which NET-SNMP – provided as part of HP’s Internet Express – supports) are not supported and cannot be accessed via HP’s SNMP daemon.

However, the HP-UX specific information is only available via the HP-UX native SNMP daemon. What is the answer?

Change one or the other to run on a non-native port, that’s the answer. With the two daemons listening on different ports – in essence, acting like to discrete damons – the capabilities of both can be exploited. Since the native HP-UX snmp daemon does not provide the capability of specifying the port, the net-snmp daemon can be moved – and it is relatively trivial to do so as well.

There is probably already a line that says:

agentaddress 161

Change this line to a new port – I used 166:

agentaddress 166

Restart the daemon. Once the NET-SNMP daemon has been moved, enable HP’s SNMP daemon (if you’ve not already done so) and start it up again:

cd /sbin/init.d
SnmpMaster start

This should enable your two SNMP daemons on different ports. Now you can access whichever one holds the data you want. For example, using the command snmpwalk, getting Caché data can be as simple as:

snmpwalk -m ALL -v 2c -c public my:166 .1.3.6.1.4.1.16563

Whereas getting HP-specific data can be retrieved this way:

snmpwalk -m ALL -v 2c -c public my .1.3.6.1.4.1.11

Note the contrast between the two commands: one accesses the host my with the standard port (my); one uses the host my with the port 166 (my:166).

As a side note, note that Caché provides AgentX subagents, and note, too, that OpenVMS supports SNMP and AgentX as of v8.x. Thus, there’s no fighting with the SNMP daemon on OpenVMS.

7 thoughts on “Using NET-SNMP and HP-UX SNMP together”

  1. I have tried the above but it seems my system is still only listening on the 161 port for the HPUX native client. I am running HPUX 11.11 and net-snmp. As far as I can tell the net-snmp agent start I did not get and error message or anything when I tried to start it. Any thoughts or suggestions.

  2. The net-snmp daemon uses the -L option to generate logging information, and the -c tells it which configuration file to use. I used this code to start it up:


    snmpd -Ls daemon -p /var/tmp/net-snmpd -c /opt/iexpress/net-snmp/snmpd.conf

    For debugging purposes, you can use this command:


    snmpd -f -Le -c /opt/iexpress/net-snmp/snmpd.conf

    With the -f the daemon will not go into the background, but will stay in the foreground where you can see what happens. The -Le will put errors onto the stderr output stream.

    To create snmpd.conf to start with, use this command:


    /opt/iexpress/net-snmp/bin/snmpconf -g basic_setup

    This will walk you through creating a valid snmpd.conf.

  3. thank you for your response. I am still not getting anything when trying to run the daemon even in debug mode. I see that on yours you are using the net-snmp client for internet express. I am not using that one. I am using a binary that was compiled for the HPUX that I downloaded of source forge. I would use the internet express version except I have been unable to obtain it for my system. I need the one for version B.11.11 and the ones on HP’s website are for B.11.23 and B.11.31 which will not load on the B.11.11 OS. here are the steps I have take to configure my system thus far along with the debug command I got from you above. Any help would be greatly appreciated.

    I have been trying to get net-snmp working on a HPUX box for over a week now. I do not think it should be this difficult. I must be missing a step. this morning I tried once again and now not even the native HPUX agent is working so I have no SNMP monitoring. So here is where I am at. Any help would be greatly apreciated.

    I stopped the HPUX agent
    /sbin/init.d/SnmpFddi4 stop
    /sbin/init.d/SnmpHpunix stop
    /sbin/init.d/SnmpMaster stop
    /sbin/init.d/SnmpMib2 stop
    /sbin/init.d/SnmpTrpDst stop

    I then installed the net-snmp client via the fallowing command

    cd /
    gzip -cd /tmp/net-snmp-5.4-1-HP-UX_B.11.11_9000_800.tar.gz | tar xvf –

    I then created an snmpd.conf file
    Create the file /usr/local/share/snmp/snmpd.conf
    with the fallowing lines

    rocommunity public

    Finally I started the net-snmp agent via
    /usr/local/sbin/snmpd

    Then I started the HPUX Agent
    /sbin/init.d/SnmpFddi4 start
    /sbin/init.d/SnmpHpunix start
    /sbin/init.d/SnmpMaster start
    /sbin/init.d/SnmpMib2 start
    /sbin/init.d/SnmpTrpDst start

    Before I did all this I was getting snmp monitoring via the native HPUX client but it was not giving me CPU and Memory information that is why I tried to install the net-snmp client. However now I am getting nothing what so ever.

    HELP ultimately I would like to have HPUX-SNMP Agent and then the net-snmp agent running as well.
    HPUX-Agent Port 161
    Net-Agent Port 163

    One other note I am running HPUX V11.11

    Pleae note I am very new to HPUX so my knowledge is limited here.
    Tags: HPUX V11.11 Native SNMP Agent & Net-SNMP Agent

    Ran this debug command.

    root@commnms # /usr/local/sbin/snmpd start -f -Le -c public /usr/local/share/snmp/snmpd.conf
    root@commnms #

    1. You don’t need to build NET-SNMP yourself; you can just use HP’s Internet Express to take all of the hard stuff out of making it work.

      Also, your command line doesn’t look like mine at all. What are the parameters “start” and “public” for? Sounds like you are confusing the server with the client. If you looked at the error code in $? you would probably find that snmpd exited with an error.

      Try something like this:

      /usr/local/sbin/snmpd -f -Le -c /usr/local/share/snmp/snmpd.conf

      That might help. Also make sure your snmpd.conf is complete.

      Or better yet, download and use HP Internet Express.

  4. I have not been able to use the HP Internet Express bundle as I have HPUX V11.11 and the net-snmp.depot files located on the link you provided are for newer versions of HPUX. So they will not run. So I downloaded the binary file from sourceforge and this is where I am at.

    root@commnms # /usr/local/sbin/snmpd -f -Le -c /usr/local/share/snmp/snmpd.conf
    [init_smux] bind failed: Address already in use
    Error opening specified endpoint “172.31.248.70:162”
    Server Exiting with code 1
    root@commnms # cat /usr/local/share/snmp/snmpd.conf
    rocommunity g0g0commnet
    agentaddress 172.31.248.70:162
    root@commnms #

    I thought I would try and run the snmpconf command but that dose not work either I get this

    # snmpconf
    sh: snmpconf: not found.
    # ./snmpconf
    sh: ./snmpconf: Execute permission denied.
    # su root
    # ./snmpconf
    sh: ./snmpconf: Execute permission denied

  5. O and I also tried this
    root@commnms # su root /usr/local/bin/snmpconf
    /usr/local/bin/snmpconf[9]: use: not found.
    /usr/local/bin/snmpconf[10]: use: not found.
    /usr/local/bin/snmpconf[11]: use: not found.
    /usr/local/bin/snmpconf[12]: use: not found.
    /usr/local/bin/snmpconf[13]: use: not found.
    /usr/local/bin/snmpconf[14]: Syntax error at line 15 : `{‘ is not expected.
    root@commnms #

  6. An alternative to this is to move the native SNMP daemon to a different port and leave Net-SNMP on udp:161. This can be accomplished by changing the default snmp port in /etc/services to some other number and then restarting all native SNMP agents as well as the System Management Homepage…

    Now if someone could tell me why Net-SNMP works great on HP-UX when querying from localhost, but not between hosts. There is no firewall. Very weird…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: