Re: build net-snmp5.5 under freebsd7

2010-01-21 Thread Alexander Bubnov
Hello all, again! net-snmp is compiled fine under freebsd. My errors are related to cross-compiling and this topic is not for net-snmp list. I am sorry to post them. Good day! Bye! 2010/1/21 Alexander Bubnov > Hello, all! > Does everybody try to build net-snmp under freebsd? If so, C

build net-snmp5.5 under freebsd7

2010-01-21 Thread Alexander Bubnov
Hello, all! Does everybody try to build net-snmp under freebsd? If so, Can you please help me? initial configure options are: ./configure --host=i686-pc-freebsd7.0 --with-sys-contact=a...@localhost--with-logfile=/home/alek/installed/var/log/snmpd.log --with-persistent-directory=/home/alek/installe

Re: disable TCP from NetBSD

2009-03-23 Thread Alexander Bubnov
ce applications that > depend on it, and I am afraid you may end up with a useless system. > > Good luck, > Nikos > > - Original Message - > *From:* Alexander Bubnov > *To:* Nikos Balkanas > *Cc:* net-snmp-users@lists.sourceforge.net > *Sent:* Monday, March

Re: disable TCP from NetBSD

2009-03-23 Thread Alexander Bubnov
edeveloping your NIC drivers. > > BR, > Nikos > > - Original Message - > *From:* Alexander Bubnov > *To:* net-snmp-users@lists.sourceforge.net > *Sent:* Sunday, March 22, 2009 7:05 PM > *Subject:* disable TCP from NetBSD > > Hello, all! I am going to pract

disable TCP from NetBSD

2009-03-22 Thread Alexander Bubnov
Hello, all!I am going to practice in net programming by writing TCP protocol. Can you please let me know how to disable TCP from NetBSD because as I guess all tcp packets will be catched by kernel? Unfortunately, I have not found the way in manual about sysctl and GENERIC conf file for kernel, just

fail mib registration after reconnection

2009-03-19 Thread Alexander Bubnov
Hello! I have the case: 1. run snmpd (machine_A) 2. run subagent (machine_B): the agent successfully registered mibs, I can get it with snmpwalk, for example. 3. force reset machine_B: just push reset button on the computer - netstat shows the connection betweeen snmpd and my agent is esta

Re: to register instance of UNICODE string

2009-02-25 Thread Alexander Bubnov
Thank you for clarification. 2009/2/26 Mike Ayers > > From: Dave Shield [mailto:d.t.shi...@liverpool.ac.uk] > > Sent: Tuesday, February 24, 2009 6:14 AM > > > Followed by a string value (16 octets) > > > > > 44 00 00 00 45 00 00 00 46 00 00 00 00 00 > > ..D...E...F. > > > 0064:

Re: to register instance of UNICODE string

2009-02-25 Thread Alexander Bubnov
Hello! I can try to fix that bug during 7 days and then send a patch to you if you do not mind 2009/2/24 Dave Shield > 2009/2/24 Alexander Bubnov : > > Sending 50 bytes to UDP: [0.0.0.0]->[127.0.0.1]:161 > : > > 0032:... 06 0D 2B 06 01 04 01 BF 08 02 04 01 01 02

Re: to register instance of UNICODE string

2009-02-24 Thread Alexander Bubnov
45 00 00 00 46 00 00 00 00 00 ..D...E...F. 0064: 00 00 .. NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = STRING: D 2009/2/24 Dave Shield > 2009/2/24 Alexander Bubnov : > > I have corrected the code, below differences: > > static const wchar_t nstAgentSubagentObject[] =

Re: to register instance of UNICODE string

2009-02-24 Thread Alexander Bubnov
> 2009/2/24 Alexander Bubnov : > > I tried to register an instance of UNICODE string: > > static const wchar_t* nstAgentSubagentObject = L"ABC"; > >[snip] > > > But snmpget prints strange set of characters: > >[snip] > > > Can you pleas

to register instance of UNICODE string

2009-02-24 Thread Alexander Bubnov
Hello! I tried to register an instance of UNICODE string: static const wchar_t* nstAgentSubagentObject = L"ABC"; void init_nstAgentSubagentObject(void) { oid nstAgentSubagentObject_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 }; netsnmp_handler_registration *reginfo; netsnmp_watch

Re: snmptrap

2009-02-22 Thread Alexander Bubnov
i think this helps http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html 2009/2/20 pch0317 > Hello, > I want to sent trap from my localhost to my localhost with snmptrap > command, but I don't know why. > I write: > snmptrap -v 1 -c public .. and don't know what next. > > Help me.

unicode in notifications: ASN_OCTET_STR or ASN_BIT8?

2009-02-20 Thread Alexander Bubnov
Hello! I would like to use unicode strings (wchar_t*,std::wstring) for sending notifications (SnmpAdminString). Which C predefine macro should I use: ASN_OCTET_STR or ASN_BIT8? Thanks in advance! -- /BR, Alexander -- Op

Re: why does uint64_t arrive with reverse order in notification?

2009-02-19 Thread Alexander Bubnov
I am sorry I foggot to out the definition: uint64_t runtime_task_id; As I understand I should not use uint64_t... Thank you. 2009/2/19 Dave Shield > 2009/2/19 Alexander Bubnov : > > snmp_varlist_add_variable( ¬ification_vars, > > persistent_task_oid, persistent_

Re: how to get table data inside request handler

2009-02-19 Thread Alexander Bubnov
I guess here what I want ./agent/mibgroup/examples/netSnmpHostsTable.c 2009/2/19 Alexander Bubnov > Thank you very much! > > Does different model from "data_set" one exist where I can change/delete > table data? > > 2009/2/19 Dave Shield > >> 2009/2/1

why does uint64_t arrive with reverse order in notification?

2009-02-19 Thread Alexander Bubnov
Hello, all! subj. is it a bug? const oid runtime_task_oid[] = {...}; const size_t runtime_task_oid_length = OID_LENGTH(runtime_task_oid); //runtime_task_id = (runtime_task_id<<32)|(runtime_task_id>>32); if I uncomment this line I can receive notification in exceted order const u_char * runtime

Re: how to get table data inside request handler

2009-02-19 Thread Alexander Bubnov
Thank you very much! Does different model from "data_set" one exist where I can change/delete table data? 2009/2/19 Dave Shield > 2009/2/18 Alexander Bubnov : > > 4. snmpwalk returns "ROW1" - how is it possible if I deleted all rows in > Watcher()? > > Y

Re: how to get table data inside request handler

2009-02-18 Thread Alexander Bubnov
alk, but not current one. Can you please help to find out a way to update the table when I receive GET requests? Thanks in advance. 2009/2/18 Alexander Bubnov > requests varibale of Watcher keeps row instead table pointer > > netsnmp_extract_table_data_set(requests); returns NULL

Re: how to get table data inside request handler

2009-02-18 Thread Alexander Bubnov
requests varibale of Watcher keeps row instead table pointer netsnmp_extract_table_data_set(requests); returns NULL netsnmp_extract_table_row(requests); returns valid data of row. What should I do to put table data inside request or how to get table data by row? 2009/2/18 Alexander Bubnov

how to get table data inside request handler

2009-02-18 Thread Alexander Bubnov
Hello, all! Can you please let me know a way getting table data to manipulate it? below code: 1. init_tables - init tables within main function. 2. Watcher - a callback, it is called when some request is received. Inside of this callback I would like to change the table content before I need to

Re: Counter64 is replaceable by INTEGER (0..18446744073709551615) for SNMP v1?

2009-02-16 Thread Alexander Bubnov
Thanks Dave for great support! 2009/2/16 Dave Shield > 2009/2/16 Alexander Bubnov : > > I am playing around with net snmp tutorials and when I register uint64_t > > variable and try to get it with help of snmpget I can see error result: > > > > linux-h110 snmp/mi

Counter64 is replaceable by INTEGER (0..18446744073709551615) for SNMP v1?

2009-02-16 Thread Alexander Bubnov
Hello! Can you please give me an advice? I am playing around with net snmp tutorials and when I register uint64_t variable and try to get it with help of snmpget I can see error result: linux-h110 snmp/mibs# snmpget -v1 -c rwpublic localhost NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 Error

Re: Cannot find module

2009-02-13 Thread Alexander Bubnov
Thanks for help. 2009/2/13 Dave Shield > 2009/2/13 Alexander Bubnov : > > Any suggestions about workaround for snmp? > > Create a .index file manually (or copy it from another system). > If this file is newer than the contents of the directory, then > the library will si

Re: Cannot find module

2009-02-13 Thread Alexander Bubnov
Thanks for replay! Any suggestions about workaround for snmp? Thanks in advance.2009/2/13 Dave Shield > 2009/2/13 Alexander Bubnov : > > if ((dir2 = opendir(tmpstr))) { > > <--- OPENDIR CAN OPEN A FILE EVEN IT IS NOT A DIRECTORY > > It shouldn't do. > >

Cannot find module

2009-02-13 Thread Alexander Bubnov
Hello, all! Can you please help me to find workaround? First of all description. As far as I know net-snmp uses mibs/.index file to remember MIB modules. I deleted that index file and net-snmp could not load any mibs with errors: Cannot find module (IP-MIB): At line 0 in (none) parse-mibs: Cann

an additional number of oid in tutorial: NET-SNMP-TUTORIAL-MIB

2009-02-11 Thread Alexander Bubnov
Hi! Tutorial: http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent. Registration example from that tutorial: void init_nstAgentSubagentObject(void) { oid nstAgentSubagentObject_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 }; ... } notice above an additional number is 0 at

Re: subagent does not receive get requests: snmpget returns Timeout: No Response

2009-02-10 Thread Alexander Bubnov
Hi, it is no problem with TCP. Thanks for help! 2009/2/10 Mike Ayers > > From: Alexander Bubnov [mailto:alexander.bub...@gmail.com] > > Sent: Monday, February 09, 2009 2:36 AM > > > Thanks for replay. For my machine firewall is not installed. > > That was my

Re: subagent does not receive get requests: snmpget returns Timeout: No Response

2009-02-09 Thread Alexander Bubnov
9/2/6 Mike Ayers > > From: Alexander Bubnov [mailto:alexander.bub...@gmail.com] > > Sent: Friday, February 06, 2009 2:05 AM > > > The root of cause is a protocol. When I change udp to tcp > > subagent can response for that get request. > > More likely, t

Re: subagent does not receive get requests: snmpget returns Timeout: No Response

2009-02-06 Thread Alexander Bubnov
Thanks a lot, David! The root of cause is a protocol. When I change udp to tcp subagent can response for that get request. 2009/2/6 Dave Shield > 2009/2/5 Alexander Bubnov : > > I have run "snmpd -Le -f -Dagentx" under one consloe and "./subagent" > > com

Re: snmp_alarm_register

2009-02-05 Thread Alexander Bubnov
Hope this help below taken from net-snmp 5.4.2.1 source code: ... /* define signal if DNE */ #ifndef have_signal #ifdef have_sigset #define signal(a,b) sigset(a,b) #endif #endif ... signal(SIGALRM, alarm_handler); ... Then you can see manual of signal system call/function. 2009/2/5 Isaac El

subagent does not receive get requests: snmpget returns Timeout: No Response

2009-02-05 Thread Alexander Bubnov
Hello! I use source code from http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent tutorial. I have run "snmpd -Le -f -Dagentx" under one consloe and "./subagent" compiled from that sources under other console. I have added to the subage code: ... debug_register_tokens("nstAgentSuba

Re: how to do reconnection by subagent in code?

2009-02-04 Thread Alexander Bubnov
; > --- On *Wed, 2/4/09, Alexander Bubnov * wrote: > > From: Alexander Bubnov > Subject: Re: how to do reconnection by subagent in code? > To: net-snmp-users@lists.sourceforge.net > Date: Wednesday, February 4, 2009, 2:38 PM > > I noticed if I change MasterAgent

Re: how to do reconnection by subagent in code?

2009-02-04 Thread Alexander Bubnov
milliseconds. 2009/2/2 Alexander Bubnov > Hello! > > I would like to change subagent settings in runtime, for example by HUP > signal. > > Settings are MasterAgent address, port and subagent ping interval. > > I tried: > > int main() > > { > > ... > > ini

snmp library: how to resend trap in case connection is down?

2009-02-03 Thread Alexander Bubnov
Hello! Can you please help me to find a solution? I wrote my own subagent and would like a manager can receive a part of traps sent when connection is down. Case: 1. master agent is down 2. subagent sends a trap through, for example, send_v2trap function <-- how can I know here that trap is n

how to do reconnection by subagent in code?

2009-02-02 Thread Alexander Bubnov
Hello! I would like to change subagent settings in runtime, for example by HUP signal. Settings are MasterAgent address, port and subagent ping interval. I tried: int main() { ... init_agent("example-demon"); init_snmp("example-demon"); ... } void OnHupSignal() /*just an example, not rea

Re: How to know subagent successfully connects to master agent or not?

2009-01-28 Thread Alexander Bubnov
Thanks for help! 2009/1/28 Dave Shield > 2009/1/28 Alexander Bubnov : > > Can you please let me know a way to do reconnection? > >$ man snmpd.conf > > AgentX Sub-Agents > > There is one directive specifically relevant to running as an > AgentX sub-agent

Re: How to know subagent successfully connects to master agent or not?

2009-01-28 Thread Alexander Bubnov
Hi! Can you please let me know a way to do reconnection? May be subagent connection tried to up in some time? Should I run init_snmp in other thread for this purpose? 2009/1/27 Alexander Bubnov > Hi! > > My application sends some events through SNMP. > In case connection

Re: How to know subagent successfully connects to master agent or not?

2009-01-27 Thread Alexander Bubnov
Hi! My application sends some events through SNMP. In case connection is fail the application can exit or try to reconnect. 2009/1/27 Dave Shield > 2009/1/26 Alexander Bubnov : > > inside call of init_snmp, subagent tries to connect to master agent. Here > > connect

Re: How to know subagent successfully connects to master agent or not?

2009-01-26 Thread Alexander Bubnov
) != SNMPERR_SUCCESS) { cerr<<"NOT CONNECTED"< > Try: > > snmpd -f -Le -Dagentx > > BR, > Nikos > > - Original Message - > *From:* Alexander Bubnov > *To:* net-snmp-users@lists.sourceforge.net > *Sent:* Monday, January 26, 2009 4:35 PM > *

How to know subagent successfully connects to master agent or not?

2009-01-26 Thread Alexander Bubnov
Hello! I am playing around with NET-SNMP library... and just what to know subj. My code looks like the tutorial one (see section TUT:Writing a Subagent, http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent): int main() { ... netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS

Re: what actions does ping interval parameter for subagnet affect?

2008-12-01 Thread Alexander Bubnov
Thanks a lot for reply, Mike! I guess snmpd informs subagnet about shutdown, is that my fault. Otherwise I cannot see differences between breaking Ethernet cable and killing the process. 2008/12/1 Mike Ayers <[EMAIL PROTECTED]> > > From: Alexander Bubnov [mailto:[EMAIL PROTECT

double free of memory as a result of subagent shutdown

2008-11-28 Thread Alexander Bubnov
Hi! The result *** glibc detected *** free(): invalid pointer: 0x0804b2d8 *** of next program int main() { netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, TRUE); netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_DONT_PERSIST_STATE, TRUE); netsnmp_ds_set_in

what actions does ping interval parameter for subagnet affect?

2008-11-28 Thread Alexander Bubnov
Hello! I wrote a simple subagent for test purpose. I set ping interval to different values 1 and 100. But the subagent waits for master reconnection the same time. Why does ping interval not affect changing that parameter? The tests case: 1. run snmpd, snmptrapd. 2. set ping interval to 100,

the meaning of agentXRetries and agentXTimeout parameters in case of subagent (snmpd -X)

2008-09-25 Thread Alexander Bubnov
Hello everyone! As far as I understand agentXRetries option defines a number of re-connections in case of communication is down between master and sub agents. subagent ---PING> there is no anyone who can answer! master agent did not response, so the subagent thinks the master is d

how to add MIB through the C API

2008-09-23 Thread Alexander Bubnov
Hello! Can you please point me the right way? As I have noticed it is possible to configure MIB PATH through some API: netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_MIBDIRS, newdir); But, unfortunately I have not found similar API for MIB files. Is there a way to add MIB file as i

Re: traps registration

2008-09-11 Thread Alexander Bubnov
Hi again! I have found out the right way! To see my object correctly I need to refer my mib file through MIBS environment variable or -m flag at snmpd startup. One more question please is it possible to register mib file using NET-SNMP API? 2008/9/11 Alexander Bubnov <[EMAIL PROTECTED]> &

traps registration

2008-09-11 Thread Alexander Bubnov
Hello! I would like to register MIB named AVPROOT. It includes some notification definitions AVPROOT = 1,3,6,1,3, ... notificator NOTIFICATION-TYPE OBJECTS { f19 } STATUS current DESCRIPTION "" ::= { AVPROOT 1 } f19 OBJECT-TYPE SYNTAX D

clarification about send_trap() calls

2008-08-27 Thread Alexander Bubnov
Hello, Here is the clarification http://www.net-snmp.org/docs/man/snmp_trap_api.html. I just would like to clarify a detail of that manual, to be exact *send_v2trap() call. *the description: ...* **uses the supplied list of variable bindings to form an SNMPv2 trap, which is sent to SNMPv2-capable

Re: Warning: Failed to connect to the agentx master agent (/var/agentx/master): Unknown host (/var/agentx/master)

2008-08-26 Thread Alexander Bubnov
Hi, it usually means that port listened by AgentX is not the same one to which subagent tries to connect. This question is often asked on mailists. try http://www.google.ru/search?complete=1&hl=ru&newwindow=1&client=firefox-a&rls=org.mozilla%3Aru%3Aofficial&hs=1jG&q=Failed+to+connect+to+the+agentx

snmptrap sends notification to agent on 161 port, is it right?

2008-08-25 Thread Alexander Bubnov
Hello! As far as I understand a manager should only be a receiver of notifications. But snmptrap sends notifications to 161, probably to be forwarded to the manager port, 162, I guess. here is from manual pages: ... snmptrap, snmpinform - sends an SNMP notification to a manager ... But snmp agent

snmpd outputs a lot of traces by unknown reason

2008-08-22 Thread Alexander Bubnov
Hi, Yesterday snmpd with -f -L options does not prints a lof of some information to console. But now it does. I do not know why that happens... can you please help to find out the reason of the problem? the output: trace: netsnmp_access_interface_container_load(): if-mib/data_access/interface.c,

tables with shared index

2008-08-07 Thread Alexander Bubnov
Hello, all! It is known tables can share its own index with other ones for relationships. For example, hrPartitionEntry OBJECT-TYPE ... INDEX { hrDeviceIndex, hrPartitionIndex } hrDiskStorageEntry OBJECT-TYPE ... INDEX { hrDeviceIndex } ... there are other tables which use hrDeviceIndex a

Re: syntax of mib txt files

2008-07-24 Thread Alexander Bubnov
Hello! Many thanks, guys! 2008/7/24 Murilo Fujita <[EMAIL PROTECTED]>: > Mike Ayers escreveu: > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Alexander Bubnov > Sent: Wednesday, July 23, 2008 3:55 AM > > > > > NET-SNMP is dist

Re: in case of a table has not primitive types:agent/mibgroup/examples/data_set.c

2008-07-24 Thread Alexander Bubnov
Hi! Thanks a lot, Mike! 2008/7/24 Mike Ayers <[EMAIL PROTECTED]>: > >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On >> Behalf Of Alexander Bubnov >> Sent: Wednesday, July 23, 2008 4:56 AM > >> I created more complex table: >> >

Re: Problem in net-snmp table

2008-07-23 Thread Alexander Bubnov
Hi, there is no response from server, most probably snmpd is not up. you can use the following command to see if snmpd listen to standard port, 161 ~/trial/snmp> netstat -a | grep snmp udp0 0 *:snmp *:* 2008/7/23 Amit Srivastava <[EMAIL PROTECTED]>: > Hi, > > > >

in case of a table has not primitive types: agent/mibgroup/examples/data_set.c

2008-07-23 Thread Alexander Bubnov
Hello, all! I am playing about with data_set.c example. It shows how to work with tables by next structure: +--mytable(1) | +--Entry(1) | Index: index | +-- Stringindex(1) |Size: 1..32 +-- CR-- Stringname1(2) +-- CR-- Stringname2

syntax of mib txt files

2008-07-23 Thread Alexander Bubnov
Hello! I am a newbie in SNMP. can you please help to find out an answer on some questions? NET-SNMP is distributed with MIB data bases which is in ${PREFIX}/snmp/mibs/ path, as far as I understand. My question is what is syntax used for these files? ASN.1? or the syntax is mixed with ASN.1? I woul

Re: snmp API: read_objid should not return an error in the case

2008-07-19 Thread Alexander Bubnov
Hi! a lot of thanks! 2008/7/18 Mike Ayers <[EMAIL PROTECTED]>: >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On >> Behalf Of Alexander Bubnov >> Sent: Friday, July 18, 2008 3:16 AM > >> I guess the cause is not in path of mib because snm

Re: snmp API: read_objid should not return an error in the case

2008-07-18 Thread Alexander Bubnov
*/ if(!read_objid("SNMPv2-MIB::sysDescr.0", anOID, &anOID_len)) snmp_perror("read_objid"); else puts("no errors"); } ~/trial/snmp> ./a.out no errors It is possible read_objid() uses different format from get_node() function... 2008/7/18 Ric

snmp API: read_objid should not return an error in the case

2008-07-18 Thread Alexander Bubnov
I am learning snmp API by tutorials (http://net-snmp.sourceforge.net/wiki/index.php/Tutorials). One of them prints an error in place where is no one as I suppose, http://net-snmp.sourceforge.net/wiki/index.php/TUT:Simple_Async_Application here is the function from that tutorial: void initialize (