I am having a managed object for holding the IP Address of the agent.
I am assigning value for this OID in my C file. This oid is read-only.

Since I am running multiple agents each with different virtual IP's on the same PC, but only one oid to hold the IP Address. I decided to use snmpget.c as the command line arguments are stored in an array called "names".

So in snmpget.c, I accessed this array and copied the IP Address to a file which can be globally accessed.

And I am reading this file and assigning it to my oid at runtime in my C file.

ie., created a file and written IP Address from the command line arguments to this file. And opened this file in read mode in my C file and read this content and assigned to the OID.

This is working fine when I execute snmpget from my shell prompt. But through NMS and MIB Browser it is failing to create the file and "Segmentation Fault" is displayed.

The file for writing IP Address is not created in snmpget.c. I doubt snmpget.c is not accessed when access through NMS and MIB Browser.

How can I proceed with this?

Thanks

On 11/16/05, aakansha rajvi <[EMAIL PROTECTED]> wrote:


On 11/14/05, Dave Shield < [EMAIL PROTECTED]> wrote:
On Mon, 2005-11-14 at 11:31 +0530, aakansha rajvi wrote:
Thomas> If it doesn't work for you (it does for me), then ...
Thomas> and post the output (of both agents)


> Output of
>   snmpd -f -Le -Dread_config,tdomain,netsnmp_udp,snmp_agent 10.0.0.11

        [snip]

And what is the output of

    snmpd -f -Le -Dread_config,tdomain,netsnmp_udp,snmp_agent 10.0.0.12
?
(which is the one that's failing, after all!)



>
> .../snmpd.conf:46 examining: trapsink  10.0.0.11 public 162
> .../snmpd.conf:53 examining: trap2sink   10.0.0.11 public 162
> .../snmpd.conf:60 examining: informsink  10.0.0.11 public 162

Argghhh!!!!

Why do you want to send *THREE* copies of every trap?!?!



> .../snmpd.conf:122 examining:
>  proxy  -Cn 10.0.0.11 -v1 -c public 10.0.0.11 .1.3.6.1.4.1.2021

Hmmm...  I thought this agent was running on 10.0.0.11 ?
Why would you want to forward proxy requests to the same agent?


> ..../snmpd.conf:152 examining: agentaddress   10.0.0.11:161

If you're trying to get the various agents to listen on
different virtual addresses, I don't think you want to hardwire
specific addresses into the config file.
  Particularly if the 10.0.0.12 version is reading the same
config file.


I strongly suggest that you start with a minimal config file
(something like  "rocommunity public"), and get things working
with that.  *Then* (and only then) look at including the rest
of the directives that you actually need.


    Thanks.. I am able to start multiple agents simultaneously.

    I would like to retrieve the IP Address provided in the snmpget command as device discovery in my NMS done with the IP Address.

    So, what I did was, in "snmpget.c" I just inserted a statement to copy the IP Address from the command line arguments.

    When I executed snmpget command from shell prompt, the inserted operation in snmpget.c is performed and it is working as I expected. But when tried from my NMS, no trace is left like the snmpget.c is read.

  That is this IP Address retrieval alone is not performed(but I am able to retrieve other values of other oids) and exiting.

 
   Could anyone pls let me know where I am doing wrong.

Dave


Reply via email to