Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Query regarding "pass" example in snmpd.conf

1,132 views
Skip to first unread message

Kevin Shaw

unread,
Jun 14, 2002, 5:04:59 AM6/14/02
to

All,

First of all, apologies for the question below, but I'm new to SNMP and
NET-SNMP.

EXAMPLE.conf contains the following example of the use of "pass":

pass .1.3.6.1.4.1.2021.255 /bin/sh $PREFIX/local/passtest

I have added this to my $HOME/.snmp/snmpd.conf file, and started my local snmpd
listening on a free port.

If I do an snmpwalk of "enterprises.ucdavis" (.1.3.6.1.4.1.2021) I get the
following lines of interest:

enterprises.ucdavis.mrTable.mrEntry.mrIndex.1.3.6.1.4.1.2021.255 = OID:
enterprises.ucdavis.255
enterprises.ucdavis.mrTable.mrEntry.mrModuleName.1.3.6.1.4.1.2021.255 = pass

Which seems OK. However, if I run the example use of snmpwalk (again from
EXAMPLE.conf):

snmpwalk -v 1 localhost public .1.3.6.1.4.1.2021.255

I get no output. And if I try:

snmpget -v 1 localhost public .1.3.6.1.4.1.2021.255.5

I get the error indicating that the variable is not in the MIB.

If I run

/bin/sh $PREFIX/local/passtest -n .1.3.6.1.4.1.2021.255

I get the expected output:

..1.3.6.1.4.1.2021.255.1
string
life the universe and everything

Both of these failures lead me to think that I have not done what I need to do
to properly register the .1.3.6.1.4.1.2021.255 MIB, but I have no idea how I
should go about doing this. Can anyone help ?

I like to know what I need to do to make the example (the use of the passtest
script) work.

Thanks in advance for any help

Kev Shaw


Tertio Limited - One Angel Square, Torrens Street, London EC1V 1PL
Tel: +44 (0)20 7843 4000 Fax: +44 (0)20 7843 4001 Web http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio Ltd.

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
Net-snmp-users mailing list
Net-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Dave Shield

unread,
Jun 14, 2002, 5:22:28 AM6/14/02
to

> EXAMPLE.conf contains the following example of the use of "pass":
>
> pass .1.3.6.1.4.1.2021.255 /bin/sh $PREFIX/local/passtest
>
> I have added this to my $HOME/.snmp/snmpd.conf file, and [it doesn't work]


I haven't really used this much myself - but one thought springs to mind.
Do you actually have the token "$PREFIX" in this file, or have you
replaced this with the appropriate path to the passtest script?
Because that would be one obvious possible cause of the script failing.

Is anything being logged by the snmpd agent?

Dave

Kevin Shaw

unread,
Jun 14, 2002, 5:37:26 AM6/14/02
to
Dave,

The file contains the full path, not the $PREFIX token. But I will have a look
at the logging produced by the snmpd.

Thanks

Kev


Dave Shield <D.T.S...@csc.liv.ac.uk> on 14/06/2002 10:03:32

Business Email

To: "Kevin Shaw" <Kevin...@tertio.com>
cc: net-snm...@lists.sourceforge.net
Subject: Re: Query regarding "pass" example in snmpd.conf

Kevin Shaw

unread,
Jun 14, 2002, 7:09:01 AM6/14/02
to

All,

Further to my email below, if I run the following snmpget:

snmpget telsun4 public .1.3.6.1.4.1.2021.255.5

I get the following in the log file with debug on:

snmp_vars: Looking for: enterprises.ucdavis.255.5 ...
trace: getStatPtr(): snmp_vars.c, 445
snmp_vars: Trying tree: enterprises.ucdavis.255 ...
trace: search_subtree_vars(): snmp_vars.c, 328
snmp_vars: Trying variable: enterprises.ucdavis.255 ...
trace: var_extensible_pass(): ucd-snmp/pass.c, 246
ucd-snmp/pass: pass-running: /bin/sh
/export/home/kshaw/ucd-snmp/ucd-snmp-4.2/local/passtest -g
..1.3.6.1.4.1.2021.255.5
open: No such file or directory

However, if I run the script with the parameters indicated, I get the following
output:

telsun4 /export/home/kshaw/ucd-snmp/ucd-snmp-4.2/bin> /bin/sh
/export/home/kshaw/ucd-snmp/ucd-snmp-4.2/local/passtest -g
..1.3.6.1.4.1.2021.255.5
..1.3.6.1.4.1.2021.255.5
counter
42

The 3 lines of output are those expected.

My feeling is that I am missing some simple piece of configuration, it's just
that I don't know what that piece of configuration is:

Any help would be gratefully received.

Kev Shaw


---------------------- Forwarded by Kevin Shaw/Tertio on 14/06/2002 11:54
---------------------------


Kevin Shaw
14/06/2002 10:27:15


Business Email

To: Dave Shield <D.T.S...@csc.liv.ac.uk>
cc: net-snm...@lists.sourceforge.net
Subject: Re: Query regarding "pass" example in snmpd.conf (Document link:
Kevin Shaw)

Dave,

The file contains the full path, not the $PREFIX token. But I will have a look
at the logging produced by the snmpd.

Thanks

Kev

Dave Shield <D.T.S...@csc.liv.ac.uk> on 14/06/2002 10:03:32

Business Email

To: "Kevin Shaw" <Kevin...@tertio.com>
cc: net-snm...@lists.sourceforge.net
Subject: Re: Query regarding "pass" example in snmpd.conf

> EXAMPLE.conf contains the following example of the use of "pass":
>
> pass .1.3.6.1.4.1.2021.255 /bin/sh $PREFIX/local/passtest
>
> I have added this to my $HOME/.snmp/snmpd.conf file, and [it doesn't work]


I haven't really used this much myself - but one thought springs to mind.
Do you actually have the token "$PREFIX" in this file, or have you
replaced this with the appropriate path to the passtest script?
Because that would be one obvious possible cause of the script failing.

Is anything being logged by the snmpd agent?

Dave

Tertio Limited - One Angel Square, Torrens Street, London EC1V 1PL


Tel: +44 (0)20 7843 4000 Fax: +44 (0)20 7843 4001 Web http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio Ltd.

_______________________________________________________________

Kevin Shaw

unread,
Jun 14, 2002, 7:36:43 AM6/14/02
to

All,

I new it woud be a stupid one. Having looked at the code, the problem is caused
by the agent not having write access to create the persistent data storage
directory. Once this is remedied, everything works OK.

Kev
---------------------- Forwarded by Kevin Shaw/Tertio on 14/06/2002 12:14
---------------------------


Kevin Shaw
14/06/2002 12:04:31


Business Email

To: net-snm...@lists.sourceforge.net
cc:

0 new messages