RE: snmpd -f (some issue)

<[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <3046C179E69FC24AB83536978A17614D76D4D0@i2km96-ukbr.domain1.systemhost.net>
Mahesh,

Try using the full path name when opening the file. Among other things snmpd will change its current working directory to / if the -f option isn't used.

Holger


-----Original Message-----
From: [email protected] on behalf of [email protected]
Sent: Thu 4/20/2006 19:46
To: [email protected]; [email protected]
Subject: RE: snmpd -f (some issue)
 
Thomas:
 
The modified file is usmDHParameters.c (net-snmp-5.2.1/agent/mibgroup/snmp-usm-dh-objects/usmDHParameters)
 
Flat file (dh_prime) contains 180 bytes of Hexadecimal numbers. Right now, I don't have actual source file of usmDHParameter.c which i modified. I am writing below the lines code which I used.
 
The following are the lines of C code added in usmDHParameters.c in init_usmDHParameters() method.
 
char dh_prime[200];
int bytes_read=0, fd=-1;
 
fd = open ("dh_prime",O_RDONLY,0);
bytes_read = read(fd, dh_prime,180);
 
dh_prime (buffer) is copied in to dh->pointer() (I don't remember exact name) in BN_Hx2Bn() method. I commented default PRIME number used by net-snmp (which we get when querying usmDHParameters scalar OID) and copied with my prime value which is fetched from my flat file.

Thanks,
Mahesh
 

________________________________

From: [email protected] on behalf of Thomas Anders
Sent: Thu 4/20/2006 11:52 PM
To: [email protected]
Subject: Re: snmpd -f (some issue)



[email protected] wrote:
> I added few lines of  C code in net-snmp source files. My code includes
> open (), read () operations on a normal file (flat/text) and handling
> some string arrays.
>
> I could read file contents and set my strings correctly and code is
> executing correctly when I run *snmpd *with* -f* option (-f: do not fork
> from the shell). But file operations are failing completely when *-f
> option* is not used along with snmpd.

We cannot help here as long as you don't show your code.


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.