 2.3.7
------------

   ,     
    SNMP.

 2.3.5
------------

   RootDirUmask,  - 027.
 ,       ,  0755 
  0775.    ,    Save 
   ,     UserName  GroupName.

 2.3.4
------------

*       .
,     Save    
 ${DATADIR.RAW} ,   ޣ ,  .
*   When    "-f", "-e"  "-d",
    test(1),   ,  
    . :

#     RRD
#    RRD      ,
#  -      .
Save "save_rrdint" {
	Exec "/usr/local/bin/rrdtool"
	When "!-f '${DATADIR.RAW}/rrdint.rrd'" 0
	"create ${DATADIR.RAW}/rrdint.rrd --step 60 DS:operstatus:GAUGE:600:0:U"
        " DS:ioct:GAUGE:600:0:U DS:ooct:GAUGE:600:0:U DS:ierr:GAUGE:600:0:U"
	" DS:oerr:GAUGE:600:0:U DS:idrp:GAUGE:600:0:U DS:odrp:GAUGE:600:0:U"
	" DS:iupk:GAUGE:600:0:U DS:oupk:GAUGE:600:0:U DS:inpk:GAUGE:600:0:U"
	" DS:onpk:GAUGE:600:0:U RRA:AVERAGE:0.5:1:3000 RRA:AVERAGE:0.5:6:3500"
	" RRA:AVERAGE:0.5:24:3875 RRA:AVERAGE:0.5:288:3985"
	Data
	"update ${DATADIR.RAW}/rrdint.rrd"
	" --template operstatus:ioct:ooct:ierr:oerr:idrp:odrp:iupk:oupk:inpk:onpk N"
	":${ifOperStatus}"
	":${ifHCInOctets.delta}"
	":${ifHCOutOctets.delta}"
	":${ifInErrors.delta}"
	":${ifOutErrors.delta}"
	":${ifInDrops.delta}"
	":${ifOutDrops.delta}"
	":${ifHCInUcastPkts.delta}"
	":${ifHCOutUcastPkts.delta}"
	":${ifHCInNcastPkts.delta}"
	":${ifHCOutNcastPkts.delta}"
}

*      
netmond,      , 
  include.

*          
    ,     pid.

 2.3.3
------------

   .

 2.3.2
------------

     SNMP , 
    .   
    SNMP .

 2.3.1
------------

      ( 
 ).

 2.3
----------

*         .
    Vsevolod Volkov <home at vvv dot kiev dot ua>.

*    bison(1),   netmond 
   yacc(1).

*     ,  
    .

*        32-  64-
   (,    ;).

*       
  .         .

 2.3b1
------------

  IgnoreIfNumberChange   
object  service.      
    .

##################################################################

SrcAddress patch

##################################################################
       IP 
  ,    
 ,      \ 
.

:

-       ,
          .
  
-     ""  
   , ,      
   IP .
  
-       ,  
     IP   ,  
       () .  
  
  "SrcAddress"

        IP  
  ,   IP     .
    -   = 0.0.0.0

    ,    IP   
     .

     -    ,  
 .

:

    SrcAddress "192.168.2.1"

    Object "somehost" {
	Address "192.168.1.2"
	SrcAddress "192.168.1.1"
	....................
    }

:

       IP  
    .  ,   
       ,   
 IP  . 
  IP      NetState . 

##################################################################

UID-GID-ChRoot Patch

##################################################################

      PIPE  FILE, ,   
,   ,   .
   "Netmod"     "root".
   -    
"root".  ,  ,  ,  
     "root"  .

    "UserName" "GroupName" "ChrootDir"
   ,     ,
(  fork,   exec )  chroot   
(    -  ),   GID,UID .

 , chroot  , UserName = netmon, GroupName= netmon.

:
    UserName   "nobody"
    GroupName  "nogroup"
    ChRootDir  "/var/netmon"

,    ,      "root".

##################################################################

NetState BindAddress Patch

##################################################################

      IP ,   NetState 
   TCP . 

  "BindAddress"   "Port".

:
    Port 3333 {
	    BindAddress	"192.168.1.1"
	    ............
    }


NetState {
    Port 3333
    BindAddress "192.168.1.1"
}


 ,   TCP     .

##################################################################

Trap Patch

##################################################################

      IP ,    
   SNMP Trap.

  "TrapBindAddress"   .

:
    TrapBindAddress	"192.168.1.1"

 ,   SNMP Trap    .

##################################################################


PID-    /var/run/netmond.pid


##################################################################

      NetState
 .

##################################################################

Object multiple states

##################################################################

    ObjectMultipleStates ( )

      .
      : UP DEGRADED WARNING DOWN NONE
(  UP DOWN NONE).  DOWN ,    
  .  DEGRADED ,  
    ,   -  .
 WARNING ,     -   -
 ,  ,  BGP peer  ENVMON   ,
  UP (NORMAL,ESTABLISHED).

   ,      .

  IgnoreState ( )   interface, 
service, bgp, envmon.    ,    
         . 
     ObjectMultipleStates.

##################################################################

Method WHEN

##################################################################

   WHEN,    
,     .   
    TRUE,       
 ,       ,
   OBJECT!methodname    
 .     DEGRADED.
:
    Method "CPU_alarm" {
	When "$LoadAve > 20" 300 "Attention! LoadAve too much! ($LoadAve)"
    }

  -        
  -  CPU, LoadAve,  ,
   .

!        
            .

##################################################################

Method PIPE

##################################################################

  .       
     .
    CHAT ,    TCP.
   ,    STDIN, 
      STDOUT.
   ,    .
 ,     
 OBJECT_NAME, OBJECT_ADDRESS, ,     
,  OBJECT_SRC_ADDRESS, OBJECT_DATADIR.
     ..................... 
     Method "CheckSSL" {
        Pipe "/usr/local/bin/check_ssl.pl" 
	Timeout 3
	ChatScript { 
	    Expect "verify"
	    Send "GET /\n\r\n\r"
	    Expect "<HTML>" 
	}
     }
     ................
/usr/local/bin/check_ssl.pl:
    #!/usr/bin/perl
    #
    $addr = $ENV{"OBJECT_ADDRESS"};                                               
    if ($ARGV[0] ) {                                                              
	$port = $ARGV[0];                                                         
    } else  {                                                                     
        $port ="443";                                                             
    }                                                                             
    $SIG{TERM} = sub {
	close PRGR;
	close PRGW;
	close STDIN;
	close STDOUT;
	kill $main::pid;
	exit(0);
    };
    use FileHandle;                                                               
    use IPC::Open2;                                                               
    $main::pid=open2(PRGR,PRGW,"/usr/bin/openssl s_client -quiet -ssl3 -connect $addr:$port");      
    $_=<STDIN>;      
    print PRGW $_;
    while  (<PRGR>){                                                              
	print STDOUT $_;                                                                 
    }                                                                             
    close STDOUT;                                                                 
    exit 0;                                                                       
    
       .
  ,      
 SIGKILL   .
       
,     TCP,  
  RSH     
     . 
        , 
   UserName GroupName.    
hRootDir,     CHROOT   .

##################################################################

     .
     INT_MAX.
    MS Windows   :

    Interface 65539 { }
    
        <kropachev(sobaka)rdu.kirov.ru>.
##################################################################

    - /usr/local/etc/netmond.conf


 2.2-b6
-------------

*    SNMP    . 
       Router, 
 Wi-Fi  D-Link.

*       SNMP .  
   .

*   ifgraph ,     
,     .

*    ifgraph.c      HH:MM:SS, 
 `t'   . ,       
,   Interface1/2003.11.01.    
 ,  ,      (  
). ,       ,  
 Save.   Anvar.Bagautdinov(at)Sun-Center.Nsk.SU.

*       ifgraph, 
  ./configure --without-ifgraph


 2.2-b5
-------------

*       RootDir,  
  2.2-b4.

*      SNMP  2 (v2c)  
 Router  SNMP.        `V2':
 Method Router V2 "snmp-community"
 Method SNMP v2 "snmp-community"

*     `Unsigned64' - 64-bits   .
      Counter64   SNMP,
      . -  
      Unsigned64 , 
 Unsigned (32-bits)   .   
  -       .

*     Router v2   Interface
  64-bits  ifHC... (Huge Counters).

*       SNMP .
     SNMP OID,   
 ,  .    
       OID,  
    .      
,      MIB.
         OID, 
 .    :

 #    CISCO-BGP-POLICY-ACCOUNTING-MIB V2
 $cbpAcctInPacketCount 1.3.6.1.4.1.9.9.148.1.1.1.2.2.0  #  0 
 $cbpAcctInOctetCount  1.3.6.1.4.1.9.9.148.1.1.1.3.2.0  # 

 Object "cisco" {
    ...
    Service "AS1234" {
        Method SNMP v2 "community" {
            $cbpAcctInPacketCount.1  #  
            $cbpAcctInOctetCount.1   #    1
        }
    }
    Service "AS5678" {
        Method SNMP v2 "community" {
            $cbpAcctInPacketCount.2  #  
            $cbpAcctInOctetCount.2   #    2
        }
    }
 }

*   netmond   ifgraph.    
    netmond.  stdin     
  ,    Save.  stdout
    PNG (libpng   ).
         
SNMP    , ,    
 .       -f, 
	ifgraph -f t_oOpPdDeE /var/netmon/router/customer/2003.08.*
       ,  
  :
	tT      UTC;
	_         ;
	oO   o= O= ;
	pP  -//- ;
	dD  -//- ;
	eE  -//- ;


 2.2-b4
-------------

*  soft-reconfig (kill -HUP)  ,  
 Interface Group "group-name".  -   
.

*       
      Save "name" "args". .

*          
. .   netmon.conf.sample.

*    ChatScript    
    . .

*    Andy Igoshin <ai(at)vsu.ru>    AIX, :
 -         ;
 -   socklen_t     OS;
 -     OS  (vsyslog, snprintf);
 -    configure.in, Makefile.in.


 2.2-a3
-------------

*       soft reconfig.

*        Env 
  ROUTER,    Aleksey V Fedorov <alexf(at)vsi.ru>.

*      SNMP  (
"Response message too big"  .)   ROUTER.  .


 2.2-a2
-------------

* - :   ROUTER (  ),
 soft reconfig ( ),   
   0 (   ).

*  PING  IP  Record Route    ,
  Retries   .   
         .


 2.2-a1
-------------

*      .  
.        
.    .  , 
        .

*     Group.     
 -       NetState  ( 
 ),   /    
 ROUTER.

*  NetState      
 (  ZLIB V1.0.6  ).    
 : COMPRESS N,  N -    0  9.
-   (COMPRESS 0).   
( )   ,    
   .

*     ROUTER.    
,    (, , bgp) 
     .   
      ,  
  sysObjID, ifNumber  sysUpTime,   
    .   -  (
)      .  .

*    : ENVVOLT -   
 (Voltage), ENVFAN -    (Fan Coolers), ENVPS -
  (Power Supply).    Cisco-specific MIB.

*   ROUTER    Batch    
 -         
   Batch -    ()
,   .    burst
     . - Batch  20.
 Timeout      .

*          
    : ifIndex, ifDescr, ifName  ifAlias.
       (
),        . 
,       Interface "name"  
 ( ),     ( 
      ).

*         ,
      (  )  
.            ,
 -          
       ( 
      ..).      
    () , 
  Sergey Babitch <vinny(at)pooh.kiev.ua>.

*      :
IFGROUP = "name,name2.." -
     ,    
.      , 
         
 .
IANAIFTYPE = "what is the interface" -
         IANA ifTypes,
      ifType  1  219.
 IFINDEX   ifIndex,   .
 ciscoIfDescr   ifAlias,   .

*      .  
      MIB ifTable, ifXTable 
Cisco-specific ( 64- ),   - 
 ""   .   
       ROUTER.  
   /,     
""  (   NOSUCHNAME),   
         .

*     netmond -M.    
SNMP soft variables  MIB,   netmond.

*      . 
     (     
).        
SNMP soft variables (/)   ,
SNMP OID    .

*       (Save )  
       
  $.  $$NAME     
 ,  $$$$$ROOTDIR    
 ROOTDIR    (   - $ 
  ).

*   PING  ,     
 `Operation timed out',     ICMP  
,     ,  'Host
unreachable', `TTL exceeded in transit'  .     
   ICMP.

*     PING    TOS,
 DF (Dont Fragment)  TTL 64.    
 1500  ( 4 ).      PING,
     IP  Record Route,  TOS  DF.

*         , 
Address, Port, Timeout, Retries  .      
.     , 
   -.     
/     ""  
 / .

*      (Save Router, Save Interface  )
  $NAME (  )     
 .

* ./configure   -  netmond  
 POSIX Threads.    ./configure --with-pthread.

*        ,
  -   :

/*
 *   ,  ,  .
 * Permit  Deny   Group    REGEX !
 */

#      NetState 
Group "Local" {
  Permit "^localhost$"
  Permit "^127\\.0\\.0\\.1$"
}

Group "remote" {
  Permit "^192\\.168\\.1\\."
}

#       
Group "Slot2" {
  Permit "^2/[0-9]+$"
  Deny ".*"	#   , -  
}

#   Port 3333...  
NetState {
  Port 3333
  Timeout 30

  #    NetState 
  Group "local"  #     
  Group "remote" #    
}

Object "switch" {
  Address "catalyst.foo.bar"

  #   NetState  /, -  
  NetState Group "local" #     
  NetState Group "remote"

  #      (hint: Address "other.host")
  Method PING { Size 4 Send 2 } #  Record Route   
  Method Router "snmp-community" { Timeout 10 Retries 1 Batch 30 }

  #   
  $Test1                        # make `Unused' variable
  $Test2 1.3.6.1.2.3.4.5.0 = -1 # integer SNMP variable
  $Test3 = 1234567890           # number
  $Test4 = "1234567890"         # string
  $Test5 = 1.3.6.1.0            # objid

  #      MIB,     
  $sysDescr = "empty"           # SNMP OID  

  #  Router     ,    
  Method snmp "snmp-community" { Port 161 $sysDescr $sysServices }

  #   
  Interface "FastEthernet1/0/0.10" #    ifDescr ( )
  Interface "Fa0/1"                #    ifName
  Interface "Customer ID"          #    ifAlias ( )

  #          
  Interface Group "Slot2" #     
  {  #      
     Description "colocation ports"
     NetState Group "local"
     #Netstate group "remote"
  }

  #    Cisco Environment Monitors
  Env Temp
  Env Volt  #   ENVVOLT
  Env Fan   #   ENVFAN
  Env PS    #   ENVPS
}



 2.1-b9
-------------

*          
 ,       
    .   ,  
  ,       .
;

*   self-watchdog    ,
         
   (     syslog).   
 netmond -w seconds (  10 ),  -
seconds           ,
 seconds 0  watchdog ;

*     Save     When 
   WHEN,      
        (  Unused 
  )   .    
   ,  WHEN  
 ,       
    Save   .
     ( NetState Spyboat)
    ,   netmond;

*      send/expect  ,
   expect ,       expect.
   .    
  tcp,      , 
  .    Pavel Gulchouck <gul(at)gul.kiev.ua>;

*      
     ADDRESS "host.foo.bar"  
      tcp, udp  icmp. 
  -  proxy,     
   ntp stratum,     - 
    ,     
 ,       ,  
      /.   
  Sergey Babitch <vinny(at)lucky.net>.


 2.1-b7
-------------

*     ,    
 (  2.1-a6);

*  ROUTER       
,      isl/dot1q ( cisco
 IOS 12.1.3T  );

*    netstate  ,   
    ;

*   netstate  ,   PING -
 ip  Record Route    , 
workaround       
ICMP (. );

*         
( 30  ,  )    
     (  BSD/OS 4.1  pthread).
         .


   2.1-a5
------------------------------

*   ROUTER      FrameRelay ;

*      ROUTER  
     ( config.h);

*  ""    SIGHUP,  
   SIGINT;

*   ,   STATE,   
LASTCHANGE -    STATE  ( .  UTC);

*        ICMP Echo,
   :

Method "name" {
        ICMP
        [ Size bytes ]
        [ Send packets [ Expect packets ] ]
        [ Timeout seconds ]
        [ Retries number ]
}
          ICMP Echo    , :
        name -   ;
        bytes -    ,   ;
        packets - - ,   0;
        seconds -     ;
        number - -      ;

       
 Send  (  Size)   - 
     (  NetState).  , 
       Expect,   
 DOWN,  UP.
 Expect  ,    Send.  Send   ,
      UP.
-  Send   Retries,  Retries  1 
""  .
 ICMP Echo   IP  Route Records,  
      PING.


  2.1-a2   
-------------------------------------------

*    $DESCRIPTION  $DATADIR  
BGPPEER  ENVTEMP   BGPAS  ENVMON;

*    ROUTER  ,   ,
  E1.     ,
       ifDescr, ifType, ifSpeed 
ifOperStatus;


  2.1-a1   
-------------------------------------------

*    event.c     
 , ,    Polling  Saving;

*   popen()   , - popen()  
    Pipe   POSIX threads,  
    Segmentation Fault;

*      (Exec, Pipe)    ,
     /bin/sh -c;

* pid-      netmond (RootDir);


    2.1-a0   2.0-a0
--------------------------------------------------------

*      tcp_send()   tcp.c 
session.c,    Segmentation Fault  tcp   
  Send;


*  SNMP ,    :

Trap Deny
          , -     
           ;

Trap SourceCheck
            IP  
          IP     , - ;

Trap "name" {
        Enterprise oid
        [ Specific number ]
        [ Community "string" ]
}
             , :
        name -   ;
        oid - Enterprise OID  (1.3.6.1...);
        number - Specific    Enterprise,   0;
        string - SNMP community, - "public";

Trap ( generic | "name" ) [ "arguments" ]
            (  );
             OID'  
         OID'      ;
        generic    Cold/Warm Start, Link Up/Down 
        BGP Peer Established/Down;
         arguments    SNMP community (  
          Community "$1");


*      cisco-, 
  :

Env Temp {
        Description "comments"
        Temp "gauge-name"
        Datadir "path"
        Save Temp
}
             ( 
        );
        gauge-name     (  ), 
        "RSP(3) hotpoint", -   ;


*     TACACS+ ,   
:

Method tacacs "secret-key"
               TACACS+;
           tacacs   "netmon" 
         "secret-key"  PAP  shared secret "secret-key";

  tacacs :

key = "secret-key"
user = netmon {
        pap = cleartext "secret-key"
}


*   POSIX threads,   configure :

./configure --without-pthread
          ;
                 
         ,    ;

  ,    NetState 
 netmond        ,
..        
  .  ,    netmond 
      -  .


*       SIGHUP.

*     FreeBSD, Linux  Solaris.


