Discussion:
Where is SNMPCONFPATH
Gemma Te
22 years ago
Permalink
Hi anybody !!!

I am reading the "man snmp-config". I have read that there exist a variable
called SNMPCONFPATH that describes where the configuration files of SNMP can
be found.

I have wrote "printenv" in my computer but I have get no variables about
SNMP; no MIBS, no SNMPCONFPATH.

Could somebody help me in finding and setting this variables.

Thanks a lot.

Gemma S Anton
Hugo Cacote
22 years ago
Permalink
Hi,


If you havent set the variable SNMPCONFPATH there's no way that
that the command printenv will output this variable.

To set environment variable use either set or export command
depending on the shell you are using.

Hope it helps,
Hugo Cacote



-----Original Message-----
From: net-snmp-users-***@lists.sourceforge.net
[mailto:net-snmp-users-***@lists.sourceforge.net]On Behalf Of Gemma Te
Sent: Wednesday, August 27, 2003 7:51 PM
To: SNMP Users
Cc: PROY Magomo
Subject: Where is SNMPCONFPATH


Hi anybody !!!

I am reading the "man snmp-config". I have read that there exist a variable
called SNMPCONFPATH that describes where the configuration files of SNMP can
be found.

I have wrote "printenv" in my computer but I have get no variables about
SNMP; no MIBS, no SNMPCONFPATH.

Could somebody help me in finding and setting this variables.

Thanks a lot.

Gemma S Anton



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Dave Shield
22 years ago
Permalink
Post by Gemma Te
I am reading the "man snmp-config". I have read that there exist a variable
called SNMPCONFPATH that describes where the configuration files of SNMP can
be found.
I have wrote "printenv" in my computer but I have get no variables about
SNMP; no MIBS, no SNMPCONFPATH.
No - this variable is not set by default, and the library will use a
built-in default. (typically something like
/usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:$HOME/.snmp)

But you can set this variable yourself, to override this list.
Post by Gemma Te
Could somebody help me in finding and setting this variables.
What shell do you use?
If you use 'bash' or one of the other "traditional" shell family, use

SNMPCONFPATH=/etc/snmp:/usr/local/etc/snmp
export SNMPCONFPATH

If you use 'csh' or one of the other C-shell based family, use

setenv SNMPCONFPATH /etc/snmp:/usr/local/etc/snmp


Dave
Dave Shield
22 years ago
Permalink
test.net-snmp.org sysUpTime
snmpgetnext: Unknown host (No such file or directory)
Correct.
There is no such host as 'test.net-snmp.org'
We do not currently offer a publicly accessible test agent.

(There used to be one at UCDavis, but the project no longer has any
real connection with that institution, and it's unfair to expect
them to keep it going for us)
localhost sysUpTime
snmpgetnext: Unknown user name
Have you set up an SNMPv3 user "noAuthUser" ?
How? What did you put in your snmpd.conf file(s)?

Dave
Dave Shield
21 years ago
Permalink
Gemma> 1.- I think that two variables belonging to different trees
Gemma> (brother trees) in the MIB can`t have the same name.

David> Hi Gemma, your suspicions are correct. You shouldn't have variables
David> with the same name on a single MIB file. It is not allowed by SMI.

But note the qualification.
You can't have MIB objects with the same name "in a single MIB file"
(or strictly speaking, in a MIB module)

It *is* permissable to have objects with the same name defined in
two different MIB modules. Often not a good idea, but perfectly valid.

As far as 'mib2c' output is concerned, this is just a template.
You can call the (C) variables by whatever name you like.
This bears no relationship whatsoever with the MIB object names.

So if you run mib2c on a subtree (split across two MIB modules) that
happens to include two MIB objects with the same name, then you'd
need to tweak the template code to distinguish between the two.

You'd probably find it easier to run mib2c on a smaller subtree,
and avoid this problem altogether. But it's a perfectly valid
way to proceed.
2.- I want to define an array inside another array.
Nope - not possible.
At least not in that form.

You'll need to define a second parallel array,
that shares the same index objects, plus extra ones.
So, I have
defined "PrLnTab" that is an array with to index, the first one is "LinInd",
a reference to the "Lin" owning the "PrLn" and the second index "PrLnInd"
makes reference to the "PrLn" inside a "Lin". Something similar has been
done for "Sec". Is correct the way I have solved this problem?
Ummm...
It's not totally clear from that description, but yes - that sounds about
right.
Would be
problematic the existence of three variables name "LinInd" is this case?
As far as the MIB definitions are concerned, you should only have
one definition of "LinInd". (Hopefully not with that name!)

You don't say which mib2c config you're using to build this table,
but I'm not sure whether any of them support tables-within-tables
like this. You'll probably have to tackle linking the tables together
yourself.

But you can certainly have multiple C variables with the same name.
The fact that they're generated by an automatic tool doesn't affect
the basic C syntax rules. If they're local to a handler routine,
then they can be called whatever you like!
3.- The third (and last question). Are the OIDs generated by mib2c when I
make "mib2c -c mib2c.scalar.conf -f sest1 sestac" for the variables
belonging to an array corrects?
What exactly do you mean by that question?

If you're using the 'mib2c.scalar' config, then this *only* deals
with scalar objects. It will completely ignore MIB tables.
So there shouldn't be anything included for any array handling.

But the OIDs for the scalar objects should match the MIB file definitions.
If those MIB files are correct, then the generated OIDs will be too.
I say that because this variables are inside
an array
By "array" do you mean "table" ?
If so, then the 'mib2c.scalar" config is the wrong one to use.


Dave
Gemma Sánchez
21 years ago
Permalink
Thank you for your answers, but this concepts are not clear enough for me.

________________________________________________________
1. With respect to the variables belonging to different trees (brother
trees) in the MIB with the same name --->

I have changed the name of those variables to avoid problems.
________________________________________________________
2. With respect to the tables inside tables --->

DAVE TOLD ME "You'll need to define a second parallel array, that shares the
same index objects, plus extra ones."

I'm not very sure if this is what I have done. I tried to do so by the way I
described, but it looks like I have not been capable of explaining it very
well. I'm going to try to describe it correctly.

The structure I want to get is the next, where I have a table "LinTab" and
two others tables ("PrLnTab" and "SecTab" ) that I want them to be sons of
"LinTab". That is, "LinTab" is a table of "Lin", and every "Lin" has several
"PrLn" and "Sec".

+--sestac(1)
|
+--LinTab(1)
| |
| +--LinEnt(1)
| | Index: LinInd
| |
| +-- ---- INTEGER LinInd(1)
| +-- CR-- String LinNom(2)
| | Textual Convention: DisplayString
| | Size: 0..40
|
+--PrLnTab(2)
| |
| +--PrLnEnt(1)
| | Index: LinInd, PrLnInd
| |
| +-- ---- INTEGER LinInd(1)
| +-- ---- INTEGER PrLnInd(2)
| +-- CR-- BitString Alarm1(3)
| Values: inactiva(0), activa(1)
|
+--SecTab(3)
| |
| +--SecEnt(1)
| | Index: LinInd, SecInd
| |
| +-- ---- INTEGER LinInd(1)
| +-- ---- INTEGER SecInd(2)
| +-- CR-- BitString Alarm2(3)
| Values: inactiva(0), activa(1)

To get it, I have defined "PrLnTab" that is a table with two index, the
first one is "LinInd" (the same as the index to the table "LinTab"), a
reference to the "Lin" owning the "PrLn" and the second index "PrLnInd"
makes reference to the "PrLn" inside a "Lin". Something similar has been
done for "Sec".
Dave Shield
21 years ago
Permalink
Dave> You'll need to define a second parallel array, that shares the
Dave> same index objects, plus extra ones."
Post by Gemma Sánchez
I'm not very sure if this is what I have done.
Going by the dump that you included, it looks as if you have.
Or at least the structure you're working towards is kosher.

I'm not sure whether this is an actual 'snmptranslate' dump
(or similar) based on a real MIB, but if so, then this looks fine.
Post by Gemma Sánchez
To get it, I have defined "PrLnTab" that is a table with two index, the
first one is "LinInd" (the same as the index to the table "LinTab"), a
reference to the "Lin" owning the "PrLn" and the second index "PrLnInd"
makes reference to the "PrLn" inside a "Lin". Something similar has been
done for "Sec".
Loading...