Operating System - HP-UX
1752794 Members
6565 Online
108789 Solutions
New Discussion юеВ

Re: SnmpExec with standard snmp

 
2xyo
Frequent Advisor

SnmpExec with standard snmp

Dear,

I have a HP-UX 11iv1 with standard snmp. I would execute a script and get the answer of this by snmp. That's why, i plan to use snmpExec.

It's is possible to us it with standard HP-UX (without additionnal bundle) ?

If yes, i already try this without success :
# echo "exec echotest /bin/echo hello world" >> /etc/snmpd.conf
# restart snmpd service

Wath is the OID ? i try this :
#snmpwalk -m ALL -v 2c -c public thehost 1.3.6.1.4.1.11|grep hello
but i have nothing...

Any idea ?
8 REPLIES 8
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

I also check that syslog is running :
#ps -ef |grep syslog
root 433 1 0 Jan 28 ? 0:00 /usr/sbin/syslogd -D

And i try :
##snmpwalk -m ALL -v 2c -c public thehost 1|grep hello
But i have nothing too..
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

up :-)
Fabio Ettore
Honored Contributor

Re: SnmpExec with standard snmp

Hi,

check if SNMP agents are up&running:

1-
ps -ef |grep -i snmp (for snmpdm)

If it's not running, issue

/sbin/init.d/SnmpMaster start

2-
ps -ef |grep -i mib (for mib2agt)

If it's not running, issue

/sbin/init.d/SnmpMib2 start

3-
ps -ef |grep -i unixagt (for hp_unixagt)

If it's not running, issue

/sbin/init.d/SnmpHpunix start

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

Thanks for your reply, but :
# ps -ef |grep -e mib -e snmp -e unixagt
root 19739 1 0 13:35:59 ? 0:00 /usr/sbin/mib2agt
root 19725 1 0 13:35:37 ? 0:00 /usr/sbin/snmpdm
root 19752 1 0 13:36:16 ? 0:00 /usr/sbin/hp_unixagt

I can talk with snmp agent without problem :
debian:~# snmpwalk -m ALL -v 2c -c public hosthp 1.3.6.1.4.1.11.2.3.1.1.7
SNMPv2-SMI::enterprises.11.2.3.1.1.7.0 = Gauge32: 3193456

The only problem is the exec option in my /etc/snmpd.conf
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

I also try this in /etc/snmpd.conf :
exec 1.3.6.1.4.1.2021 echotest /bin/echo hello world

Whitout success
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

There is an interesting section in the man of anmpdm :

-e extendFile This option is provided for backward compatibility
with the pre-emanate snmpd.ea extensible SNMP
agent. It is applicable only to the script
/usr/sbin/snmpd, and only if the EMANATE
extensible agent is installed. It is installed if
the file /usr/sbin/extsubagt exists. This option
causes the extsubagt to use the command line
specified extendFile instead of the default file
/etc/SnmpAgent.d/snmpd.extend to add user defined
MIB objects to the SNMP agent.

But EMANATE is not installed...
Fabio Ettore
Honored Contributor

Re: SnmpExec with standard snmp

Hi,

I'm not sure but I've never seen this kind of configuration for snmpd.conf in HP-UX. Maybe it does exist on Linux systems where I see the file /etc/snmpd/snmpd.conf contains examples about how to use exec in snmp configuration.
Someone could contradict about this, if so no problem but I think snmpd.conf configuration between HP-UX and Linux is not the same.

Questions: do you have some HP-UX systems which is working with exec in snmpd.conf? Or is it something you're trying for the first time on HP-UX?
Do you have some Linux systems working well with that configuration?

Best regards,
Fabio
WISH? IMPROVEMENT!
2xyo
Frequent Advisor

Re: SnmpExec with standard snmp

>Hi,
Hi,

>Questions: do you have some HP-UX systems which is working with exec in snmpd.conf?
No

>Or is it something you're trying for the first time on HP-UX?
Yes...

>Do you have some Linux systems working well with that configuration?
Yes !

>I'm not sure but I've never seen this kind of configuration for snmpd.conf in HP-UX. Maybe it does exist on Linux systems where I see the file /etc/snmpd/snmpd.conf contains examples about how to use exec in snmp configuration.
>Someone could contradict about this, if so no problem but I think snmpd.conf configuration between HP-UX and Linux is not the same.
If it's not possible to use this linux feature, there is an other way in HP-UX to have an equivalent of exec ? (any solution to get the output of a sh script by snmp)

>Best regards,
>Fabio
Thank you