|
hi
I am trying to extend an agent for the example in the tutorial.
1. I have copied the nstAgentModuleObject.h and nstAgentModuleObject.c files in the agent/mibgroups dir
2. I can run snmptranslate and get the object identified
3. ./configure --with-mib-modules="nstAgentModuleObject"
once done
snmpd -I INITLIST option helps sayeed <sabinasayeed2003 <at> yahoo.com>
2004-03-31 23:35:14 GMT
Could anyone know how to use
snmp -I INITLIST
option to add an new module to the initlist?
Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time.
Re: snmp trap forwardingDave Shield <D.T.Shield <at> csc.liv.ac.uk>
2004-04-01 08:35:55 GMT
> Will the information in this trap be exactly as it is before it's
> forwarded.
It should be - yes.
Checking the code, the forward handler just clones the PDU
and sends it on.
> What I actually wanted to do is to modify the trap by appending a new
> field and then forward it on.
> Unfortunately, it's very difficult to create a generic script to decode
> the snmptrap using the traphandle script and then reconstruct the
> snmtrap arguments to mimic the incoming trap.
No - that's probably not very easy with the external handler script
mechanism. Not least because all traps are converted to v2-style
form before the script is invoked.
One possibility would be to use the existing 'forward_handler' routine
as a template, and write your own handler routine to append the extra
information that you need. See 'apps/snmptrapd_handlers.c'
Unfortunately this does require re-compiling the code - we don't have
a "loadable module" mechanism for the traphandler.
Alternatively, I believe the main CVS traphandler does include a perl-based
trap handler mechanism, which might serve your purposes. Wes should be
able to tell you more about that.
But it's only in the CVS line - I don't think it's included in the
5.1.x line.
Dave
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: script for snmpsetDave Shield <D.T.Shield <at> csc.liv.ac.uk>
2004-04-01 08:54:45 GMT
> > Remember that the whitespace and quotes are interpreted by the shell,
> > So the shell will strip off the quotes and pass the
> > $VAL value as a single parameter, regardless of whether it contains
> > whitespace, or is an integer, or an OID, or whatever.
>
> Really? See that's why I'll never master scripting. In C, if you have
> a string "27", that is the actual ASCII characters 0x32, 0x37, 0x00.
Yup.
And in the shell, this'd be regarded in much the same way.
> I'm
> not used to having things magically transform from quoted string to
> integer without first doing an atoi or something.
No - it doesn't. It regards *everything* as a sequence of characters.
The strings "27" or "whatever" or "a string of characters" are handled
in much the same way as far as the shell is concerned.
One of the main jobs of the shell is to parse the single command line
string, and split it up into the separate tokens that are passed to other
applications via the 'argv[]' array.
So the command
runme this that the other 12345
will appear to the 'runme' command as:
argv[0] = "runme";
argv[1] = "this";
argv[2] = "that";
argv[3] = "the";
argv[4] = "other";
argv[5] = "12345";
argc = 6;
while
runme this that "the other"
will appear to the 'runme' command as:
argv[0] = "runme";
argv[1] = "this";
argv[2] = "that";
argv[3] = "the other";
argv[4] = "12345";
argc = 5;
> So what happens (I know, I know; this is now entirely not a Net-SNMP
> thread anymore) if I do this:
> $VAL < cat $VAL "z"
Err.... probably a syntax error!
You're running a command called $VAL (i.e. whatever that contains)
and redirecting input from a file 'cat' (which probably doesn't exist)
> Don't know if this is proper syntax
No - not even close. Sorry
> but you get the point that now I've
> changed VAL's value from "27" to "27z"
Ah! You mean:
VAL="${VAL}z"
> and now I call snmpset of an integer OID with this value.
Then the 'snmpset' command will probably throw an error.
> I figure I would get BAD_VALUE returned from the agent
No - the assignment would never get as far as being sent to the agent.
Unless you explictly said that this was a string (and didn't validate
the assignment against the MIB file), in which case the agent would
reject it with a 'wrongType' error.
> since the shell was not able to magically convert that to an int for me.
The shell doesn't try to convert it to an integer.
That's handled by the 'snmpset' command.
> Set prtGeneralCurrentLocalization.1 "3"
> and
> Set prtGeneralCurrentLocalization.1 3
>
> work just fine. This is an integer OID. Setting it to "3z" gives bad
> value. Also,
>
> Set sysContact.0 "27"
> and
> Set sysContact.0 27
>
> worked without problems. This may be easier for the user to not have to
> remember whether to use quotes or not, but I still don't like it.
No - that just means that your command now works like every single other
Unix command does.
If a given parameter is a single token (i.e. it doesn't contain any
white space), then it doesn't make any difference whether you quote it
or not.
If a given parameter consists of multiple tokens (i.e. it does
contain white space, but needs to be treated as a single value),
then you do need to quote it.
Try comparing the behaviour of
ls this that the other
and
ls this that "the other"
Dave
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: Helpful scripts Get, Next, SetDave Shield <D.T.Shield <at> csc.liv.ac.uk>
2004-04-01 09:04:14 GMT
> The following scripts allow you to use snmpget, snmpgetnext, and
> snmpset by only typing in the name of the script and the OID.
Unfortunately, they won't work with a default v5 installation
> snmpget -c$COMM -mALL -M$MIBDIR $AGENT $OID
This command assumes SNMPv1 or SNMPv2c, but the default version with
a default net-snmp configuration is SNMPv3.
You probably ought to set the version explicitly.
> # set the path to look for MIBs and set community name
> MIBDIR="/usr/local/share/snmp/mibs"
This is probably also unwise.
The 'snmpget' command will probably be looking there already, since
this is the default location for MIB files. And if they have been
installed somewhere elsewhere, then 'snmpget' would use the MIBDIRS
environmental variable or the 'mibdir' config directive to spot this.
By hardwiring this location using -M, you're stopping these mechanisms
from working, and ensuring that the commands will *ONLY* look in the
one place that they'd be looking in anyway.
I don't think you need the -M flag at all.
Dave
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Fw: Helpful scripts Get, Next, SetCarlos Cantu <ccantu <at> us.ibm.com>
2004-04-01 16:02:02 GMT
> You probably ought to set the version explicitly.
>
> I don't think you need the -M flag at all.
Good tips. Thanks.
linux kernel 2.6Critchley, Amy <acritchley <at> rpco2.com>
2004-04-01 16:48:23 GMT
Does anybody know if net-snmp 5.1.1 will run on Linux kernel 2.6?
Thanks,
Amy
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
user configuration program in C for generating snmpd.confJoao Miguel Ferreira <jmf <at> estg.ipvc.pt>
2004-04-01 17:46:40 GMT
Hello all
does anyone know of a simple program in C to generate simple
configuration files (snmpd.conf).
...trapsinks, comunities and eventually com2sec directives.... in C
I need to write this program except if it has already been written...
I need to prompt my user to collect simple information for the
snmpd.conf file in order to keep users away from manipulating it
directly.... in C
thank you.
jmf
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Help SNMP::UtilWilliam Zapata <wzapata97 <at> yahoo.com>
2004-04-01 20:16:56 GMT
Can any help me with this module SNMP::Util?? i have troubles
_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Re: snmp and the Dell PowerEdgeYilmaz Atag <yilmaz.atag <at> abs.gov.au>
2004-04-01 22:09:36 GMT
Tinka wrote on 01/04/2004
>I tried looking for the appropriate
>MIBs on dell.com and support.dell.com,
> but can't find anytning. Does
>anyone know where i can find them?
Try here;
http://www.mibdepot.com/index.shtml
Yilmaz.
-----------------------------------------------
ABS Web Site: www.abs.gov.au
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users <at> lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
Group
Advertisement
Project Web Page
Search Archive
Page
Articles in period: 439
April 2004
Language
Options
Recent entries
Archives
Design
Your Own Design
|