Roxen.git / server / base_server / snmpagent.pike

version» Context lines:

Roxen.git/server/base_server/snmpagent.pike:1:   /* -  * $Id: snmpagent.pike,v 1.1 2001/06/25 21:43:44 hop Exp $ +  * $Id: snmpagent.pike,v 1.2 2001/06/26 23:18:14 hop Exp $    *    * The Roxen SNMP agent    * Copyright © 2001, Roxen IS.    *    * Author: Honza Petrous    * January 2001         RFC 1156 base MIB (done marked by *):    system:
Roxen.git/server/base_server/snmpagent.pike:16:    sysL    snmp:    snmpInPkts *    snmpOutPkts *   RFC 2248 Network Services Monitoring MIB      Developer notes:       Known issues:    - every reload spawne a new thread, I guess that old ones are never -  used then. [threads leak] -  - every reload add a new record about opened UDP port (at least -  on Linux, try 'netstat -ap | grep udp-port-number'. [fd leak] +  used then. [threads leak] // FIXME: solved by switching to the async i/o    Todos:    v1.0 todo:    - cold/warm start trap generation    - 'basic' Roxen working variables -  - leaking fixes +        v1.1 todo:    - trap handling       v2.0 todo:    - Roxen.module API for registering MIB subtree       v3.0 todo:    - SNMP v3    - security
Roxen.git/server/base_server/snmpagent.pike:76:   #define RET_NEXTOID(oidnext) if(op == SNMP_OP_GETNEXT) rdata += ([attrname:({"oid", oidnext+".0"})])   //#define RET_VALUE(arr) if(op == SNMP_OP_GETREQUEST) rdata[attrname] += arr   #define RET_VALUE(arr) rdata[attrname] += arr   #define LOG_EVENT(txt, pkt) log_event(txt, pkt)      // base external feeders      int get_null() { return 0; }   //! External function for MIB object returning nothing    - string get_description() { return("Roxen Webserver generic SNMP agent v0.2 (development rel."); } + string get_description() { return("Roxen Webserver SNMP agent v"+("$Revision: 1.2 $"/" ")[1]+" (devel. rel.)"); }   //! External function for MIB object 'system.sysDescr'      string get_sysoid() { return RISMIB_BASE_WEBSERVER; }   //! External function for MIB object 'system.sysOID'      int get_uptime() { return ((time(1) - roxen->start_time)*1000); }   //! External function for MIB object 'system.sysUpTime'      string get_syscontact() { return query("snmp_syscontact"); }   //! External function for MIB object 'system.sysContact'
Roxen.git/server/base_server/snmpagent.pike:371:       private void start() {       events = ([]);    if(!inited) {    inited++;    SNMPAGENT_MSG("Initializing...");    //fd = Stdio.UDP(); //Port();      #if NO_THREADS -  SNMPAGENT_MSG("Threads don't detected. Async I/O used intstead."); +  //SNMPAGENT_MSG("Threads don't detected. Async I/O used intstead.");    co = call_out( real_start, 1 );   #else -  SNMPAGENT_MSG("Threads detected. One thread will be created for agent processing."); +  //SNMPAGENT_MSG("Threads detected. One thread will be created for agent processing.");    th = thread_create( real_start );   #endif    }    }       void stop() {       SNMPAGENT_MSG("Shutting down...");    fd->set_read_callback(0);    catch(fd->set_blocking());    catch(fd->close());   #if NO_THREADS    remove_call_out(co);   #else    th = 0;   #endif -  +  destruct(fd); // avoid fd leaking; FIXME: some cyclic dependencies in SNMP pmod.    fd = 0;    inited = 0;    SNMPAGENT_MSG("Shutdown complete.");    }      /*    string status2() {    string rv = "";       rv = "<h2>SNMP access table</h2>\n";