home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-24 | 75.7 KB | 2,357 lines |
- Newsgroups: comp.sources.misc
- From: vikas@jvnc.net (Vikas Aggarwal)
- Subject: v40i154: nocol - Network Monitoring System, Part24/26
- Message-ID: <1993Nov24.163918.2079@sparky.sterling.com>
- X-Md4-Signature: b5cbcf7f47b9998708d9344d71b53b1c
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Wed, 24 Nov 1993 16:39:18 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: vikas@jvnc.net (Vikas Aggarwal)
- Posting-number: Volume 40, Issue 154
- Archive-name: nocol/part24
- Environment: INET, UNIX
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: nocol-3.0/src/README
- # nocol-3.0/src/cmu-snmp/include/parse.h
- # nocol-3.0/src/cmu-snmp/include/snmp_auth.c
- # nocol-3.0/src/cmu-snmp/include/snmp_impl.h
- # nocol-3.0/src/cmu-snmp/man/snmpgetnext.1
- # nocol-3.0/src/cmu-snmp/man/variables.5
- # nocol-3.0/src/cmu-snmp/snmplib/parse.h
- # nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c
- # nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h
- # nocol-3.0/src/doc/eventselect.8 nocol-3.0/src/doc/genmon.8
- # nocol-3.0/src/doc/pingmon.8 nocol-3.0/src/doc/tpmon.8
- # nocol-3.0/src/include/nsmon.h nocol-3.0/src/include/tpmon.h
- # nocol-3.0/src/netmon/help_page.c nocol-3.0/src/netmon/msg_dpy.c
- # nocol-3.0/src/nsmon/poll_sites.c
- # nocol-3.0/src/perlnocol/armon-confg nocol-3.0/src/perlnocol/rcisco
- # nocol-3.0/src/tpmon/poll_sites.c nocol-3.0/src/tpmon/tptest.1
- # Wrapped by kent@sparky on Tue Nov 9 22:22:28 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 24 (of 26)."'
- if test -f 'nocol-3.0/src/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/README'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/README'\" \(2657 characters\)
- sed "s/^X//" >'nocol-3.0/src/README' <<'END_OF_FILE'
- X$Header: /home/aggarwal/lsrc/nocol/src/RCS/README,v 1.3 1993/10/30 04:50:34 aggarwal Exp $
- X
- XREADME for NOCOL v3.0
- X=====================
- X
- XNOCOL (Network Operation Center On-Line) is a network monitoring
- Xpackage that runs on Unix platforms. It can monitor various network
- Xvariables such as ICMP reachability, nameservers, SNMP traps, modem
- Xline usage, appletalk & novell routes and services, BGP peers, etc.
- X
- XThe software consists of a number of monitoring agents that poll various
- Xparameters (from any system) and put it into a common format. All the
- Xmonitors have a common display and postprocessing interface (such as logging,
- Xnotification, etc.). The design also allows running just one set of
- Xmonitoring agents and *any* number of display agents, and all of the displays
- Xsee the same consistent set of data. Additionally, each event is assigned a
- Xpre-determined severity which is gradually escalated, thus preventing false
- Xalarms and a customized priority notification based on the severity. The
- Xseverity levels range from Critical thru Info.
- X
- XThe display uses UNIX 'curses' screen management and can thus run on a large
- Xvariety of terminals. The user running the display can select the minimum
- Xdisplay priority- only events above this minimum priority level are displayed.
- X
- XTo date, the various monitoring agents developed are:
- X
- X - IP ICMP monitor (using 'ping' or 'multiping')
- X - OSI reachability monitor (using the OSI ping)
- X - SNMP trap monitor
- X - IP data throughput monitor
- X - Nameserver (named) monitor
- X - Monitor for usage of terminal server modem lines in use
- X - Appletalk route monitor (for cisco routers)
- X - Novell service monitor
- X - BGP peer status (if not connected)
- X - TCP port monitor
- X
- X
- XA PERL interface has been provided (jmwobus@mailbox.syr.edu) for
- Xdeveloping additional monitors in the PERL programming language. It is
- Xeasy to add additional monitors for system load, etc.
- X
- XNew features are:
- X----------------
- X
- X - Large portions of the code cleaned up.
- X - Logging facility (similar to syslogd)
- X - Perl interface
- X - TCP port monitor
- X - Perl appletalk, Novell, BGP, modem line monitors.
- X
- X
- X
- XHas been tested on Solaris2.2, SunOS4.1.1, Ultrix4.2.
- X
- XThe software is available from 'ftp.jvnc.net' (128.121.50.2) under
- X~ftp/pub/jvncnet-packages/nocol/nocol.tar.Z.
- X
- XPlease send a message to 'nocol-users-request@jvnc.net' to be added to the
- X'nocol-users' mailing list for updates and bug fixes. Mail comments to
- X'nocol-info@jvnc.net' and bugs to 'nocol-bugs@jvnc.net'.
- X
- XThe JvNCnet display monitor can be viewed by logging onto 'nocol.jvnc.net'
- Xas user 'nocol'.
- X
- X
- X Vikas Aggarwal (vikas@jvnc.net)
- X JvNCnet, GES
- X Nov 1, 1993
- X --------------
- END_OF_FILE
- if test 2657 -ne `wc -c <'nocol-3.0/src/README'`; then
- echo shar: \"'nocol-3.0/src/README'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/README'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/parse.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/parse.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/parse.h'\" \(2568 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/parse.h' <<'END_OF_FILE'
- X/***********************************************************
- X Copyright 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X/*
- X * parse.h
- X */
- X
- X/*
- X * A linked list of tag-value pairs for enumerated integers.
- X */
- Xstruct enum_list {
- X struct enum_list *next;
- X int value;
- X char *label;
- X};
- X
- X/*
- X * A linked list of nodes.
- X */
- Xstruct node {
- X struct node *next;
- X char label[32]; /* This node's (unique) textual name */
- X u_long subid; /* This node's integer subidentifier */
- X char parent[32];/* The parent's textual name */
- X int type; /* The type of object this represents */
- X struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
- X};
- X
- X/*
- X * A tree in the format of the tree structure of the MIB.
- X */
- Xstruct tree {
- X struct tree *child_list; /* list of children of this node */
- X struct tree *next_peer; /* Next node in list of peers */
- X struct tree *parent;
- X char label[32]; /* This node's textual name */
- X u_long subid; /* This node's integer subidentifier */
- X int type; /* This node's object type */
- X struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
- X void (*printer)(); /* Value printing function */
- X};
- X
- X/* non-aggregate types for tree end nodes */
- X#define TYPE_OTHER 0
- X#define TYPE_OBJID 1
- X#define TYPE_OCTETSTR 2
- X#define TYPE_INTEGER 3
- X#define TYPE_NETADDR 4
- X#define TYPE_IPADDR 5
- X#define TYPE_COUNTER 6
- X#define TYPE_GAUGE 7
- X#define TYPE_TIMETICKS 8
- X#define TYPE_OPAQUE 9
- X#define TYPE_NULL 10
- X
- Xstruct tree *read_mib();
- X
- END_OF_FILE
- if test 2568 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/parse.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/parse.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/parse.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/snmp_auth.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/snmp_auth.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/snmp_auth.c'\" \(3037 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/snmp_auth.c' <<'END_OF_FILE'
- X/*
- X * snmp_auth.c -
- X * Authentication for SNMP (RFC 1067). This implements a null
- X * authentication layer.
- X *
- X *
- X */
- X/***********************************************************
- X Copyright 1988, 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X
- X#ifdef KINETICS
- X#include "gw.h"
- X#include "fp4/cmdmacro.h"
- X#endif
- X
- X#if (defined(unix) && !defined(KINETICS))
- X#include <sys/types.h>
- X#include <netinet/in.h>
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X#endif
- X
- X#include "asn1.h"
- X#include "snmp.h"
- X#include "snmp_impl.h"
- X
- Xu_char *
- Xsnmp_auth_parse(data, length, sid, slen, version)
- X u_char *data;
- X int *length;
- X u_char *sid;
- X int *slen;
- X long *version;
- X{
- X u_char type;
- X
- X data = asn_parse_header(data, length, &type);
- X if (data == NULL){
- X ERROR("bad header");
- X return NULL;
- X }
- X if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)){
- X ERROR("wrong auth header type");
- X return NULL;
- X }
- X data = asn_parse_int(data, length, &type, version, sizeof(*version));
- X if (data == NULL){
- X ERROR("bad parse of version");
- X return NULL;
- X }
- X data = asn_parse_string(data, length, &type, sid, slen);
- X if (data == NULL){
- X ERROR("bad parse of community");
- X return NULL;
- X }
- X sid[*slen] = '\0';
- X return (u_char *)data;
- X}
- X
- Xu_char *
- Xsnmp_auth_build(data, length, sid, slen, version, messagelen)
- X u_char *data;
- X int *length;
- X u_char *sid;
- X int *slen;
- X long *version;
- X int messagelen;
- X{
- X data = asn_build_header(data, length, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), messagelen + *slen + 5);
- X if (data == NULL){
- X ERROR("buildheader");
- X return NULL;
- X }
- X data = asn_build_int(data, length,
- X (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
- X (long *)version, sizeof(*version));
- X if (data == NULL){
- X ERROR("buildint");
- X return NULL;
- X }
- X data = asn_build_string(data, length,
- X (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
- X sid, *slen);
- X if (data == NULL){
- X ERROR("buildstring");
- X return NULL;
- X }
- X return (u_char *)data;
- X}
- END_OF_FILE
- if test 3037 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/snmp_auth.c'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/snmp_auth.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/snmp_auth.c'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/snmp_impl.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/snmp_impl.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/snmp_impl.h'\" \(2591 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/snmp_impl.h' <<'END_OF_FILE'
- X/*
- X * Definitions for SNMP (RFC 1067) implementation.
- X *
- X *
- X */
- X/***********************************************************
- X Copyright 1988, 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X
- X
- X#if (defined vax) || (defined (mips))
- X/*
- X * This is a fairly bogus thing to do, but there seems to be no better way for
- X * compilers that don't understand void pointers.
- X */
- X#define void char
- X#endif
- X
- X/*
- X * Error codes:
- X */
- X/*
- X * These must not clash with SNMP error codes (all positive).
- X */
- X#define PARSE_ERROR -1
- X#define BUILD_ERROR -2
- X
- X#define SID_MAX_LEN 64
- X#define MAX_NAME_LEN 64 /* number of subid's in a objid */
- X
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X
- X#ifndef TRUE
- X#define TRUE 1
- X#endif
- X#ifndef FALSE
- X#define FALSE 0
- X#endif
- X
- X#define READ 1
- X#define WRITE 0
- X
- X#define RONLY 0xAAAA /* read access for everyone */
- X#define RWRITE 0xAABA /* add write access for community private */
- X#define NOACCESS 0x0000 /* no access for anybody */
- X
- X#define INTEGER ASN_INTEGER
- X#define STRING ASN_OCTET_STR
- X#define OBJID ASN_OBJECT_ID
- X#define NULLOBJ ASN_NULL
- X
- X/* defined types (from the SMI, RFC 1065) */
- X#define IPADDRESS (ASN_APPLICATION | 0)
- X#define COUNTER (ASN_APPLICATION | 1)
- X#define GAUGE (ASN_APPLICATION | 2)
- X#define TIMETICKS (ASN_APPLICATION | 3)
- X#define OPAQUE (ASN_APPLICATION | 4)
- X
- X#ifdef DEBUG
- X#define ERROR(string) printf("%s(%d): %s",__FILE__, __LINE__, string);
- X#else
- X#define ERROR(string)
- X#endif
- X
- X/* from snmp.c*/
- Xextern u_char sid[]; /* size SID_MAX_LEN */
- X
- Xu_char *snmp_parse_var_op();
- Xu_char *snmp_build_var_op();
- X
- Xu_char *snmp_auth_parse();
- Xu_char *snmp_auth_build();
- END_OF_FILE
- if test 2591 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/snmp_impl.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/snmp_impl.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/snmp_impl.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1'\" \(2605 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1' <<'END_OF_FILE'
- X.\* /***********************************************************
- X.\" Copyright 1988, 1989 by Carnegie Mellon University
- X.\"
- X.\" All Rights Reserved
- X.\"
- X.\" Permission to use, copy, modify, and distribute this software and its
- X.\" documentation for any purpose and without fee is hereby granted,
- X.\" provided that the above copyright notice appear in all copies and that
- X.\" both that copyright notice and this permission notice appear in
- X.\" supporting documentation, and that the name of CMU not be
- X.\" used in advertising or publicity pertaining to distribution of the
- X.\" software without specific, written prior permission.
- X.\"
- X.\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- X.\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- X.\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- X.\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- X.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- X.\" SOFTWARE.
- X.\" ******************************************************************/
- X.TH SNMPGETNEXT 1 "17 September 1989"
- X.UC 4
- X.SH NAME
- Xsnmpgetnext - communicates with a network entity using SNMP GET NEXT Requests.
- X.SH SYNOPSIS
- Xsnmpgetnext host community variable-name [variable-name]...
- X.SH DESCRIPTION
- XSnmpget is an SNMP application that uses the GET NEXT Request to query for
- Xinformation on a network entity. One or more object
- Xidentifiers may be given as arguments on the command line.
- XEach variable name is given in the format specified in
- X.IR variables (5).
- XFor each one, the variable that is lexicographicly "next" in the remote entity's
- XMIB will be returned.
- X.PP
- XThe
- X.I host
- Xspecification may be either a host name or an internet address
- Xspecified in "dot notation"
- X.PP
- XThe
- X.I community
- Xspecifies the community name for the transaction with the remote system.
- X.PP
- XFor example
- X.PP
- X.I snmpgetnext netdev-kbox.cc.cmu.edu public system.sysdescr system.sysUpTime
- X.PP
- Xwill retrieve the variables sysDescr.0 and sysUpTime.0:
- X.PP
- X.I Name: system.sysDescr.0
- X.br
- X.I OCTET STRING- (ascii): Kinetics FastPath2
- X.PP
- X.I Name: system.sysUpTime.0
- X.br
- X.I Timeticks: (2270351) 6:18:23
- X.PP
- XIf the network entity has an error processing the request packet, an error
- Xmessage will be shown, helping to pinpoint in what way the request was malformed.
- X.PP
- XAdding a "-d" to the argument list will cause the application to dump input and output packets.
- X.PP
- X.SH "SEE ALSO"
- Xvariables(5), RFC 1065, RFC 1066, RFC 1067
- END_OF_FILE
- if test 2605 -ne `wc -c <'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/man/snmpgetnext.1'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/man/variables.5' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/man/variables.5'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/man/variables.5'\" \(2850 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/man/variables.5' <<'END_OF_FILE'
- X.\* /***********************************************************
- X.\" Copyright 1988, 1989 by Carnegie Mellon University
- X.\"
- X.\" All Rights Reserved
- X.\"
- X.\" Permission to use, copy, modify, and distribute this software and its
- X.\" documentation for any purpose and without fee is hereby granted,
- X.\" provided that the above copyright notice appear in all copies and that
- X.\" both that copyright notice and this permission notice appear in
- X.\" supporting documentation, and that the name of CMU not be
- X.\" used in advertising or publicity pertaining to distribution of the
- X.\" software without specific, written prior permission.
- X.\"
- X.\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- X.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- X.\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- X.\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- X.\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- X.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- X.\" SOFTWARE.
- X.\" ******************************************************************/
- X.TH VARIABLES 5 "17 September 1989"
- X.UC 4
- X.SH NAME
- X variables - Format of specifying variable names to SNMP tools.
- X.SH SYNOPSIS
- X system.sysdescr.0
- X.SH DESCRIPTION
- XVariable names are in the format of Object Identifiers (ASN.1). There are
- Xseveral methods of representation. Each variable name is given in the format of A.B.C.D...,
- Xwhere A, B, C, and D are subidentifiers in one of two forms of notation.
- XEach subidentifier may be encoded as a decimal integer, or a symbol as found in
- Xthe RFC1066 MIB. The case of the symbols is not significant.
- X.br
- XIf there is no leading "." in the variable name, the name will be formed
- Xas if having been preceded with "iso.org.dod.internet.mgmt.mib.". A "." must
- Xbe placed before the first variable if the user is to fully specify the name.
- XFor example:
- X.PP
- X.I 1.1.0 system.sysDescr.0 and 1.sysDescr.0
- X.PP
- Xall refer to the same variable name. Likewise:
- X.PP
- X.I .1.3.6.1.2.1.1.1.0 .iso.org.dod.internet.mgmt.mib.system.sysdescr.0 .1.3.6.1.2.1.1.sysdescr.0
- X.PP
- XAll refer to the same variable name.
- X.PP
- XThe description of the variables in the MIB is given in a file named
- X.I "mib.txt"
- Xin the current directory or in a file named in the environment variable
- X.I "MIBFILE" or in
- X.I "/etc/mib.txt".
- XThese files are searched in the above order. The files are in the ASN.1 notation and use the
- XOBJECT TYPE macro defined in RFC 1065. Most of the file describing the RFC 1066 MIB is pulled
- Xout of RFC 1066 without change.
- X.SH "SEE ALSO"
- XRFC 1065, RFC 1066, RFC 1067, ISO IS 8824(ASN.1)
- X.SH BUGS
- XThe parser of the
- X.I "mib.txt"
- Xfile is not expected to handle bizarre (although correct) interpretations of the ASN.1 notation.
- X
- X
- END_OF_FILE
- if test 2850 -ne `wc -c <'nocol-3.0/src/cmu-snmp/man/variables.5'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/man/variables.5'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/man/variables.5'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/parse.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/parse.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/parse.h'\" \(2568 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/parse.h' <<'END_OF_FILE'
- X/***********************************************************
- X Copyright 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X/*
- X * parse.h
- X */
- X
- X/*
- X * A linked list of tag-value pairs for enumerated integers.
- X */
- Xstruct enum_list {
- X struct enum_list *next;
- X int value;
- X char *label;
- X};
- X
- X/*
- X * A linked list of nodes.
- X */
- Xstruct node {
- X struct node *next;
- X char label[32]; /* This node's (unique) textual name */
- X u_long subid; /* This node's integer subidentifier */
- X char parent[32];/* The parent's textual name */
- X int type; /* The type of object this represents */
- X struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
- X};
- X
- X/*
- X * A tree in the format of the tree structure of the MIB.
- X */
- Xstruct tree {
- X struct tree *child_list; /* list of children of this node */
- X struct tree *next_peer; /* Next node in list of peers */
- X struct tree *parent;
- X char label[32]; /* This node's textual name */
- X u_long subid; /* This node's integer subidentifier */
- X int type; /* This node's object type */
- X struct enum_list *enums; /* (optional) list of enumerated integers (otherwise NULL) */
- X void (*printer)(); /* Value printing function */
- X};
- X
- X/* non-aggregate types for tree end nodes */
- X#define TYPE_OTHER 0
- X#define TYPE_OBJID 1
- X#define TYPE_OCTETSTR 2
- X#define TYPE_INTEGER 3
- X#define TYPE_NETADDR 4
- X#define TYPE_IPADDR 5
- X#define TYPE_COUNTER 6
- X#define TYPE_GAUGE 7
- X#define TYPE_TIMETICKS 8
- X#define TYPE_OPAQUE 9
- X#define TYPE_NULL 10
- X
- Xstruct tree *read_mib();
- X
- END_OF_FILE
- if test 2568 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/parse.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/parse.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/parse.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c'\" \(3037 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c' <<'END_OF_FILE'
- X/*
- X * snmp_auth.c -
- X * Authentication for SNMP (RFC 1067). This implements a null
- X * authentication layer.
- X *
- X *
- X */
- X/***********************************************************
- X Copyright 1988, 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X
- X#ifdef KINETICS
- X#include "gw.h"
- X#include "fp4/cmdmacro.h"
- X#endif
- X
- X#if (defined(unix) && !defined(KINETICS))
- X#include <sys/types.h>
- X#include <netinet/in.h>
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X#endif
- X
- X#include "asn1.h"
- X#include "snmp.h"
- X#include "snmp_impl.h"
- X
- Xu_char *
- Xsnmp_auth_parse(data, length, sid, slen, version)
- X u_char *data;
- X int *length;
- X u_char *sid;
- X int *slen;
- X long *version;
- X{
- X u_char type;
- X
- X data = asn_parse_header(data, length, &type);
- X if (data == NULL){
- X ERROR("bad header");
- X return NULL;
- X }
- X if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)){
- X ERROR("wrong auth header type");
- X return NULL;
- X }
- X data = asn_parse_int(data, length, &type, version, sizeof(*version));
- X if (data == NULL){
- X ERROR("bad parse of version");
- X return NULL;
- X }
- X data = asn_parse_string(data, length, &type, sid, slen);
- X if (data == NULL){
- X ERROR("bad parse of community");
- X return NULL;
- X }
- X sid[*slen] = '\0';
- X return (u_char *)data;
- X}
- X
- Xu_char *
- Xsnmp_auth_build(data, length, sid, slen, version, messagelen)
- X u_char *data;
- X int *length;
- X u_char *sid;
- X int *slen;
- X long *version;
- X int messagelen;
- X{
- X data = asn_build_header(data, length, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), messagelen + *slen + 5);
- X if (data == NULL){
- X ERROR("buildheader");
- X return NULL;
- X }
- X data = asn_build_int(data, length,
- X (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),
- X (long *)version, sizeof(*version));
- X if (data == NULL){
- X ERROR("buildint");
- X return NULL;
- X }
- X data = asn_build_string(data, length,
- X (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),
- X sid, *slen);
- X if (data == NULL){
- X ERROR("buildstring");
- X return NULL;
- X }
- X return (u_char *)data;
- X}
- END_OF_FILE
- if test 3037 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/snmp_auth.c'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h'\" \(2591 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h' <<'END_OF_FILE'
- X/*
- X * Definitions for SNMP (RFC 1067) implementation.
- X *
- X *
- X */
- X/***********************************************************
- X Copyright 1988, 1989 by Carnegie Mellon University
- X
- X All Rights Reserved
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted,
- Xprovided that the above copyright notice appear in all copies and that
- Xboth that copyright notice and this permission notice appear in
- Xsupporting documentation, and that the name of CMU not be
- Xused in advertising or publicity pertaining to distribution of the
- Xsoftware without specific, written prior permission.
- X
- XCMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- XCMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- XSOFTWARE.
- X******************************************************************/
- X
- X
- X#if (defined vax) || (defined (mips))
- X/*
- X * This is a fairly bogus thing to do, but there seems to be no better way for
- X * compilers that don't understand void pointers.
- X */
- X#define void char
- X#endif
- X
- X/*
- X * Error codes:
- X */
- X/*
- X * These must not clash with SNMP error codes (all positive).
- X */
- X#define PARSE_ERROR -1
- X#define BUILD_ERROR -2
- X
- X#define SID_MAX_LEN 64
- X#define MAX_NAME_LEN 64 /* number of subid's in a objid */
- X
- X#ifndef NULL
- X#define NULL 0
- X#endif
- X
- X#ifndef TRUE
- X#define TRUE 1
- X#endif
- X#ifndef FALSE
- X#define FALSE 0
- X#endif
- X
- X#define READ 1
- X#define WRITE 0
- X
- X#define RONLY 0xAAAA /* read access for everyone */
- X#define RWRITE 0xAABA /* add write access for community private */
- X#define NOACCESS 0x0000 /* no access for anybody */
- X
- X#define INTEGER ASN_INTEGER
- X#define STRING ASN_OCTET_STR
- X#define OBJID ASN_OBJECT_ID
- X#define NULLOBJ ASN_NULL
- X
- X/* defined types (from the SMI, RFC 1065) */
- X#define IPADDRESS (ASN_APPLICATION | 0)
- X#define COUNTER (ASN_APPLICATION | 1)
- X#define GAUGE (ASN_APPLICATION | 2)
- X#define TIMETICKS (ASN_APPLICATION | 3)
- X#define OPAQUE (ASN_APPLICATION | 4)
- X
- X#ifdef DEBUG
- X#define ERROR(string) printf("%s(%d): %s",__FILE__, __LINE__, string);
- X#else
- X#define ERROR(string)
- X#endif
- X
- X/* from snmp.c*/
- Xextern u_char sid[]; /* size SID_MAX_LEN */
- X
- Xu_char *snmp_parse_var_op();
- Xu_char *snmp_build_var_op();
- X
- Xu_char *snmp_auth_parse();
- Xu_char *snmp_auth_build();
- END_OF_FILE
- if test 2591 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/snmp_impl.h'
- fi
- if test -f 'nocol-3.0/src/doc/eventselect.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/eventselect.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/eventselect.8'\" \(3237 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/eventselect.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/eventselect.8,v 1.2 1993/10/28 16:38:03 aggarwal Exp $
- X.\"
- X.TH EVENTSELECT 8 "October 1, 1993"
- X.SH NAME
- Xeventselect \- NOCOL event selector.
- X.SH SYNOPSIS
- X.B eventselect
- X[
- X.B \-d
- X] [
- X.B \-l
- X] [
- X.B \-s
- X.I <sender>
- X] [
- X.B \-S
- X.I <site name>
- X] [
- X.B \-v
- X.I <severity as Critical|Error|Warning|Info>
- X] [
- X.B \-f
- X.I <fromtime>
- X] [
- X.B \-t
- X.I <to time>
- X] [
- X.I nocol-data-files ...
- X]
- X.\"
- X.SH DESCRIPTION
- X.LP
- X.B eventselect
- Xparses all NOCOL format data files and outputs only those events that
- Xmatch the criterion specified on the command line. The output of
- X.B eventselect
- Xis text strings in the nocol LOG format.
- X
- XThe program is useful for running periodically from the
- X.I crontab
- Xand list all sites that are in a particular severity for more than a
- Xcertain amount of time (like escalate the problem internally and
- Xsend email to someone else within a group).
- X
- XEvents can be selected based on the site-name, the monitor (sender)
- Xname, the severity and the time stamp of the event. Multiple site and
- Xsender names can be specified. The time can also be specified as
- Xincremental values (seconds from the current time).
- X
- XThe matching events are printed out on the standard output as text
- Xlines in the nocol log (
- X.IR noclogd (8)
- X) format. Optionally, the events can be sent to the logging daemon (in
- Xcase the
- X.I noclogd
- Xdaemon starts up later and we need to log the existing state of the
- Xevents to the logging daemon).
- X
- X.SH OPTIONS
- X.TP 3
- X.B \-d
- Xprints debugging output.
- X.TP 3
- X.B \-l
- Xlog matching events to the \fI noclogd\fR daemon. Useful to log existing
- Xevents in case the logging daemon starts up after the various monitors.
- X.TP 3
- X.B \-s
- X.I <sender name>
- XThis is the name of the NOCOL monitoring program (EVENT.sender). Multiple
- Xsender names can be specified using multiple '\-s' options. A sub-string
- Xwill also be matched.
- X.TP 3
- X.B \-S
- X.I <site name>
- XThis is the name of the site (EVENT.site.name). Multiple site-names can
- Xbe specified by repeating the '\-S' options.
- X.TP 3
- X.B \-v
- X.I <minimum severity>
- XMinimum severity of the event (critical or error or warning or info). Only
- Xthe first letter need to be specified.
- X.TP 3
- X.B \-f
- X.I <from time>
- XThe minimum timestamp of the events. It is specified in the Unix 'date'
- Xformat (Oct 1, 1993 23:15). It can also be specified as an incremental
- Xvalue (number of seconds from the current time) by prefixing the number
- Xof seconds with a '+' sign (+3600 means in the past 1 hour=3600secs).
- XDefault (if no value is specified) time is zero (beginning of eternity).
- X.TP 3
- X.B \-t
- X.I <to time>
- XThis is the maximum timestamp of the events. It has the same format as
- Xthe
- X.I from-time
- Xdescribed above.
- X.sp
- X.I e.g.
- X.RS
- X eventselect
- X\-s pingmon \-s tpmon \-S bellcore \-S rutgers \-v E
- X\-f 'Oct 25 05:00' -t +3600
- X.RE
- X.TP 3
- X.I nocol-data-files
- XThis is a list of NOCOL format datafiles that are to be processed. If
- Xno file is specified, the program reads from the standard input (
- X.I stdin
- X).
- X.\"------------------------------------
- X.SH AUTHOR
- XVikas Aggarwal, JvNCnet (vikas@jvnc.net).
- X.SH SEE ALSO
- Xnocol(1) nocol-prog(3) perlnocol(3)
- Xeventselect(8) genmon(8) noclogd(8) nocol-overview(8)
- Xnocol-utility(8) nsmon(8) pingmon(8) portmon(8)
- Xtpmon(8) trapmon(8)
- X
- END_OF_FILE
- if test 3237 -ne `wc -c <'nocol-3.0/src/doc/eventselect.8'`; then
- echo shar: \"'nocol-3.0/src/doc/eventselect.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/eventselect.8'
- fi
- if test -f 'nocol-3.0/src/doc/genmon.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/genmon.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/genmon.8'\" \(2775 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/genmon.8' <<'END_OF_FILE'
- X.\" $Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/genmon.8,v 1.2 1993/10/28 16:38:03 aggarwal Exp $
- X.\"
- X.TH GENMON 8 "Oct 1 1993"
- X.SH NAME
- Xgenmon \- Generic NOCOL monitoring interface
- X.SH SYNOPSIS
- X.B genmon
- X[
- X.B \-d
- X] [
- X.B \-e
- X.I prog-to-execute
- X] [
- X.B \-a
- X.I 'args to program'
- X]
- X.LP
- XThe
- X.I genmon
- Xprogram parses nocol LOG format
- X.I text
- Xstrings and creates the NOCOL format datafiles which can then be parsed
- Xby the various NOCOL post-processors.
- X.SH OPTIONS
- X.TP
- X.B \-d
- XFor debug mode. Will not daemonize and writes errrors to terminal.
- X.TP
- X.B \-e
- X.I <program to execute>
- XFull path to the program that is run
- X.TP
- X.B \-a
- X.I <arguments>
- XThis is a list of arguments for the program to be executed. Enclose
- Xmultiple arguments within single quotes.
- X
- X.SH DESCRIPTION
- X.LP
- XThe
- X.B genmon
- Xprocess provides a simple interface for developing additional monitors
- Xfor NOCOL. It reads in EVENT text lines (of the format generated by
- X.IR noclogd (8)
- X), and creates NOCOL data structures. Additionally, it recognizes the
- X.I LOG
- Xkeyword for logging the event to the noclogd daemon and the
- X.I APPEND
- Xkeyword for seeking to the end of the existing output datafile before
- Xwriting additional nocol events.
- X.LP
- XThe typical format of the NOCOL text lines (of the
- X.I noclogd
- Xformat) are:
- X.RS
- X.I date
- X[
- X.I sender
- X]: SITE
- X.I sitename address
- XVAR
- X.I varname value threshold units
- XLEVEL
- X.I severity
- XLOGLEVEL
- X.I log severity
- XNOCOP
- X.I up down unknown test
- X.RE
- X
- XThus, any monitoring front-end process (could be a shell script) can
- Xoutput text lines in the above format and create a NOCOL format datafile.
- XThere are two ways to use this program:
- X.RS
- X mymonitor | genmon > DATADIR/mymonitor-output
- X.RE
- XIn this mode, the 'APPEND' keyword is ignored since the output is written
- Xto the stdout.
- XAlternatively, you can use:
- X.RS
- X genmon \-e mymonitor \-a 'mymonitors various flags'
- X.RE
- XIn this mode, genmon forks and opens a datafile in the nocol data directory.
- XIt then invokes the program specified on the command line and reads text
- Xlines from the stdout of the process being called. If it scans an
- XAPPEND keyword, it seeks to the end of the datafile before writing (it only
- Xneeds this once in each pass). It then sleeps for SLEEPTIME (15 secs)
- Xand then calls the monitoring program again. Keep in mind that since
- Xthe monitoring process is re-invoked each time, it has no way of
- Xremembering the state of the events it monitored in the previous passes.
- XThus, the 'APPEND' keyword should be used with caution (as you don't want
- Xto go on appending to the datafile each time).
- X
- X.SH AUTHOR
- XVikas Aggarwal, JvNCnet (vikas@jvnc.net)
- X.SH SEE ALSO
- Xnocol(1) nocol-prog(3) perlnocol(3)
- Xeventselect(8) genmon(8) noclogd(8) nocol-overview(8)
- Xnocol-utility(8) nsmon(8) pingmon(8) portmon(8)
- Xtpmon(8) trapmon(8)
- X
- END_OF_FILE
- if test 2775 -ne `wc -c <'nocol-3.0/src/doc/genmon.8'`; then
- echo shar: \"'nocol-3.0/src/doc/genmon.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/genmon.8'
- fi
- if test -f 'nocol-3.0/src/doc/pingmon.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/pingmon.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/pingmon.8'\" \(3322 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/pingmon.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/pingmon.8,v 1.3 1993/10/28 16:38:03 aggarwal Exp $
- X.\"
- X.TH PINGMON 8 "October 1, 1993"
- X.SH NAME
- Xpingmon \- NOCOL ICMP reachability monitor (
- X.IR ip pingmon
- X&
- X.IR osi pingmon)
- X.SH SYNOPSIS
- X.B ippingmon
- X[
- X.B \-d
- X] [
- X.B \-o
- X.I <output-data-file>
- X] [
- X.B \-p
- X.I <ping command>
- X] [
- X.I config-file
- X]
- X.\"
- X.SH DESCRIPTION
- X.LP
- X.B ippingmon
- X(and
- X.BR osipingmon )
- Xare NOCOL monitors for testing reachability of IP (OSI) hosts via the
- XICMP
- X.I ping
- Xprogram. The monitor uses the standard Unix
- X.I ping
- Xprogram to send 10 ICMP packets to the list of hosts psecified in the
- Xconfiguration file and if the number of lost packets exceeds a certain
- Xthreshold (set to 3 packets by default), the site is marked as DOWN and
- Xthe NOCOL severity of the site is escalated. In each pass, if the site
- Xis still unreachable, the severity is escalated (till it reaches
- XCRITICAL). Thus, when a site is marked as CRITICAL, it has been ping-ed
- Xand marked unreachable atleast 3 times (thus avoiding false alarms).
- X
- XThe program does a
- X.IR popen (3)
- Xcall to the ping program and parses the last two output lines of the
- Xprogram. The
- X.I osiping
- Xprogram available with OSI protocol software also produces similar output
- Xas the IP ping program, so it can be used instead of the IP
- X.I ping
- Xprogram. The corresponding monitor is called
- X.I osipingmon
- Xand it can be given a list of OSI nodes with OSI addresses.
- X
- XSince the list of nodes can get quite large and it can take a large
- Xamount of time before a site is tested again, it has been adapted to
- Xwork with the
- X.IR multiping (8)
- Xprogram (also available with the NOCOL distribution). It is advised
- Xto use this program instead of the standard Unix ping program for large
- Xnumber of sites. No such program is available (at this time) for OSI
- Xnetworks.
- X.\"
- X.SH OPTIONS
- X.TP 5
- X.B \-d
- Xprints debugging output.
- X.TP 3
- X.BI \-o " <output-data-file>"
- XThe name of the nocol format datafile produced by ippingmon. By default,
- Xthis file is ETCDIR/ippingmon-output.
- X.TP 3
- X.BI \-p <ping-program>
- XThis is the path to the
- X.I ping
- Xprogram to be used for sending ICMP packets to the remote hosts.
- XThis must produce output summary lines in the format:
- X.RS
- X.sp
- X.DS
- X r2d2% ping -s nisc.jvnc.net 100 10 | tail -2
- X 5 packets transmitted, 5 packets received, 0% packet loss
- X round-trip (ms) min/avg/max = 4/5/7
- X.DE
- X.sp
- X.RE
- XSet the default location of the ping program during compile time (or
- Xif you are using
- X.I multiping
- Xinstead).
- X.TP 3
- X.I <config-file>
- XThis is the list of IP nodes. The default filename is ETCDIR/ipnodes (osinodes
- Xfor the osipingmon monitor).
- XThe format of this file is:
- X.RS
- X.sp
- X.DS
- X POLLINTERVAL secs
- X.br
- X sitename address
- X.br
- X site2 address test
- X.DE
- X.RE
- X.sp
- XThe
- X.I test
- Xkeyword sets the NOCOP
- X.I test
- Xoption in the EVENT structure. This is useful to mark sites that are
- XNOT in production yet and need to be monitored. The post-processors
- Xcan then differentiate between test sites and production sites.
- X.SH CAVEATS
- XThe program expects to parse fixed format \fIping\fR output.
- X.\"------------------------------------
- X.SH AUTHOR
- XVikas Aggarwal, JvNCnet (vikas@jvnc.net).
- X.SH SEE ALSO
- Xnocol(1) nocol-prog(3) perlnocol(3)
- Xeventselect(8) genmon(8) noclogd(8) nocol-overview(8)
- Xnocol-utility(8) nsmon(8) pingmon(8) portmon(8)
- Xtpmon(8) trapmon(8)
- X
- END_OF_FILE
- if test 3322 -ne `wc -c <'nocol-3.0/src/doc/pingmon.8'`; then
- echo shar: \"'nocol-3.0/src/doc/pingmon.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/pingmon.8'
- fi
- if test -f 'nocol-3.0/src/doc/tpmon.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/tpmon.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/tpmon.8'\" \(3323 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/tpmon.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/tpmon.8,v 1.3 1993/10/28 16:38:03 aggarwal Exp $"
- X.\"
- X.TH TPMON 8 "June 9, 1992"
- X.SH NAME
- Xtpmon \- TCP/IP network throughput measuring program
- X.SH SYNOPSIS
- X.B tpmon
- X[
- X.B \-d
- X] [
- X.B \-o
- X.I output-file
- X]
- X.I config-file
- X.SH DESCRIPTION
- X.LP
- X.B tpmon
- Xis part of the NOCOL network monitoring package from JvNCnet, used for
- Xmeasuring the throughput (bits per second) to a remote networked site.
- X
- XThe program reads in the list of sites to test from a config file at startup
- Xand then tests the throughput by dumping data to the
- X.I discard
- Xport (TCP port 9) on the remote hosts. It keeps track of the amount of data
- Xsent and the time to send it, and calculates the throughput in bits
- Xper second. If the measured throughput drops below the set threshold value
- X(in the configuration file), then the
- X.I severity
- Xfor that site is incremented. However, the severity is not incremented beyond
- XWARNING (this is because the intent of the program is more towards providing
- Xinformation than realtime monitoring. Furthermore, the thruput is a function
- Xof the network load, system load, etc. and can only be considered a rough
- Xestimate).
- X
- XThe program sleeps for POLLINTERVAL seconds between each run through the
- Xlist of hosts. This should be set to about 2 hours or more (7200) to avoid
- Xloading the system and the network.
- X
- XThe program is useful for
- X.I comparing
- Xthe throughputs to various sites. The output indicates the throughput rate in
- XKbits per second.
- X
- X.SH OPTIONS
- X.TP 16
- X.B \-d
- Xselects verbose debugging output mode
- X.TP
- X.BI "\-o" " output file"
- XName of the file to which to write the output. This file is
- X.I not
- Xin human-readable format, and is intended to be processed by the
- X.BR nocol (1)
- Xdisplay program.
- X.TP
- X.I config-file
- XThis file lists the hosts to be tested for throughput and the threshold
- Xlevels. It also has the sleep interval between tests.
- X
- XThe format of this file is:
- X.RS
- X.sp
- X.DS
- XPOLLINTERVAL secs
- X.br
- X<SiteName> <IPaddress> <Threshold in Kbps> [TEST]
- X.DE
- X.RE
- X.sp
- X.IP
- XThe
- X.I sitename
- Xis there only for the operator's benefit and thus does not have to be a full
- Xname. The second column is the site's IP address. The third column
- Xis the lower threshold for throughput in Kbits per second (i.e.
- X1000 is 1 megabit per second)- if the throughput drops below this, the site
- Xwill be elevated to the WARNING level. The TEST keyword sets the n_TEST flag
- Xin the
- X.I nocop
- Xfield for the event which is then used by the post-processors (nocol, etc.).
- X.\"------------------------------------
- X.SH AUTHOR
- XS. Spencer Sun (spencer@phoenix.princeton.edu, spencer@jvnc.net) for JvNCnet.
- X.SH CAVEATS
- X.LP
- XThe measured throughput is a function of the network load, the end system
- Xload and the intermediate hops. Hence, it can only be used as a rough
- Xestimate.
- X
- XThe program should
- X.I not
- Xbe used for connecting to routers because of the additional CPU load on the
- Xrouter (typically, router CPU's don't need to process every packet since the
- Xpacket can be switched by the I/O card directly).
- XFurthermore, the router might give lower priority to discard port
- Xconnections.
- X.\"------------------------------------
- X.SH SEE ALSO
- Xnocol(1) nocol-prog(3) perlnocol(3)
- Xeventselect(8) genmon(8) noclogd(8) nocol-overview(8)
- Xnocol-utility(8) nsmon(8) pingmon(8) portmon(8)
- Xtpmon(8) trapmon(8)
- X
- END_OF_FILE
- if test 3323 -ne `wc -c <'nocol-3.0/src/doc/tpmon.8'`; then
- echo shar: \"'nocol-3.0/src/doc/tpmon.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/tpmon.8'
- fi
- if test -f 'nocol-3.0/src/include/nsmon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/include/nsmon.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/include/nsmon.h'\" \(3330 characters\)
- sed "s/^X//" >'nocol-3.0/src/include/nsmon.h' <<'END_OF_FILE'
- X/*
- X * $Header: /home/aggarwal/lsrc/nocol/src/include/RCS/nsmon.h,v 1.3 1993/10/30 03:03:19 aggarwal Exp $
- X */
- X#ifndef __NSMON_H__
- X#define __NSMON_H__
- X
- X
- X/*
- X * FILE DEFINITIONS
- X *
- X * DATADIR is the location of the datafile. The name is prepended to
- X * PINGOUTPUT to create the output filename.
- X *
- X * NODESFILE is the full name of the file containing the list of hosts
- X * and ip addresses.
- X *
- X * The program needs to know the location of the 'ping' progam that is
- X * to be used.
- X */
- X
- X#ifndef DATADIR
- X#define DATADIR "../../data"
- X#endif
- X
- X#ifndef NODESFILE
- X#define NODESFILE "../../etc/nsmon-confg"
- X#endif
- X
- X/*
- X * The progam automatically fills in its own name in the EVENT.sender
- X * field. If you want to over-ride this name with your own, then define
- X * SENDER
- X */
- X/* #define SENDER "nsmon" /* */
- X
- X/*
- X * Extension of the output datafile. DATADIR/prognm is tacked onto this name.
- X */
- X#define NSMONOUTPUTEXT "-output"
- X
- X/*
- X * CONSTANTS
- X */
- X#ifndef BUFSIZ /* in stdio.h */
- X#define BUFSIZ 1024
- X#endif /* BUFSIZ */
- X
- X#define MAXLINE 128 /* Randomly selected string lengths */
- X
- X#define VARNM "named status" /* for EVENT.var.name field */
- X#define VARUNITS "SOA" /* Units name (none)*/
- X#define DEBUG_FLG "NOCOL_DEBUG" /* run in debug mode if set */
- X#define POLLINTERVAL (time_t)60 /* interval between queries */
- X
- X /*
- X * C_IN and T_SOA are #defined in /usr/include/arpa/nameser.h.
- X *
- X * QUERY is the actual data with which to query the server. If the
- X * data is not needed just #define it to "". For example, if QUERY
- X * is T_PTR, then nsmon will construct a query by taking the IP# of
- X * the server and making an in-addr.arpa out of it, so no QUERY is
- X * needed, but it needs to be #defined to avoid compiler errors.
- X */
- X
- X#define QUERYTIMEOUT 20 /* timeout connections in this many seconds */
- X#define QUERYCLASS C_IN /* query class */
- X#define QUERYTYPE T_SOA /* type of query to make */
- X#define QUERY_AA_ONLY 0 /* set to 1 to set RES_AAONLY flag of _res */
- X#ifndef QUERYDATA
- X# define QUERYDATA "jvnc.net"
- X#endif
- X
- X/*
- X * Global variables
- X */
- X#ifdef GLOBALS
- X#define EXTERN
- X#else
- X#define EXTERN extern
- X#endif
- X
- XEXTERN int debug;
- XEXTERN char *prognm; /* Program name */
- XEXTERN char *sender; /* Name used in the v.sender field */
- XEXTERN char ipnodes[MAXLINE]; /* File with the list of nodes */
- XEXTERN char datafile[MAXLINE] ; /* Names of the data file */
- XEXTERN char querydata[MAXLINE]; /* Query data string (domainname) */
- X
- X/*
- X * nsmon() -- does all the dirty work
- X *
- X * input parameters:
- X * server: address of the nameserver to be queried (MUST be an IP #)
- X * request: query to be passed to nameserver. If type is T_SOA then
- X * this needs to be a domain name
- X * class: a class, probably C_IN, as defined in <arpa/nameser.h>
- X * type: query type, probably T_SOA, as defined in <arpa/nameser.h>
- X * timeout: if no response in this many seconds, give up
- X * flags: options as defined below
- X *
- X * return values: defined below
- X */
- X
- Xint nsmon(/* char *server, char *request, int class, int type,
- X int timeout, int aa_only, int debug */);
- X
- X/* return codes from nsmon() */
- X
- X#define ALL_OK 0 /* everything's groovy */
- X#define NOT_AUTHORITATIVE 1 /* got a response, but not auth. */
- X#define ERROR 2 /* no response, or connection */
- X
- X#endif /* __NSMON__H__ */
- X
- X
- END_OF_FILE
- if test 3330 -ne `wc -c <'nocol-3.0/src/include/nsmon.h'`; then
- echo shar: \"'nocol-3.0/src/include/nsmon.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/include/nsmon.h'
- fi
- if test -f 'nocol-3.0/src/include/tpmon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/include/tpmon.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/include/tpmon.h'\" \(3217 characters\)
- sed "s/^X//" >'nocol-3.0/src/include/tpmon.h' <<'END_OF_FILE'
- X/*
- X * $Header: /nocol/src/include/RCS/tpmon.h,v 1.1 1992/06/12 21:08:20 aggarwal Exp $
- X */
- X#ifndef __TPMON_H__
- X#define __TPMON_H__
- X
- X
- X/*
- X * FILE DEFINITIONS
- X *
- X * DATADIR is the location of the datafile. The name is prepended to
- X * the programs own name to create the output filename.
- X *
- X * NODESFILE is the full name of the thruput config file
- X * and ip addresses.
- X *
- X */
- X
- X#ifndef DATADIR
- X#define DATADIR "../../data"
- X#endif
- X
- X#ifndef NODESFILE
- X#define NODESFILE "../../etc/tpmon-confg"
- X#endif
- X
- X/*
- X * The progam automatically fills in its own name in the EVENT.sender
- X * field. If you want to over-ride this name with your own, then define
- X * SENDER
- X */
- X/* #define SENDER "thruputmon" /* About 16 characters possible ? */
- X
- X/*
- X * Extension of the output datafile. DATADIR/prognm is tacked onto this name.
- X */
- X#define TPMONOUTPUTEXT "-output"
- X
- X/*
- X * CONSTANTS
- X */
- X#ifndef BUFSIZ /* in stdio.h */
- X#define BUFSIZ 1024
- X#endif /* BUFSIZ */
- X
- X#define MAXLINE 127 /* Randomly selected string lengths */
- X
- X#define VARNM "Thruput" /* for EVENT.var.name field */
- X#define VARUNITS "Kbps" /* Units name */
- X#define DEBUG_FLG "TPMON_DEBUG" /* to run in debug mode if set */
- X#define POLLINTERVAL (time_t)(2 * 3600) /* interval between queries */
- X
- X#define PORT_NUMBER 9 /* tcp discard port */
- X#define NUM_BYTES 0L /* default num_blocks */
- X#ifdef BUFSIZ /* in stdio.h */
- X#define BLOCKSIZE BUFSIZ /* default blocksize */
- X#endif /* BUFSIZ */
- X#define PATTERN NULL /* default pattern == none == random */
- X#define RUN_TIME 30 /* default secs of test run */
- X /* see below for the effects of having both time and blocksize non-zero */
- X
- X/*
- X * Global variables
- X */
- X#ifdef GLOBALS
- X#define EXTERN
- X#else
- X#define EXTERN extern
- X#endif
- X
- XEXTERN int debug;
- XEXTERN time_t pollinterval; /* Time between polls */
- XEXTERN char *prognm; /* Program name */
- XEXTERN char *sender; /* Name used in the v.sender field */
- XEXTERN char ipnodes[MAXLINE]; /* File with the list of nodes */
- XEXTERN char datafile[MAXLINE] ; /* Name of the data file */
- XEXTERN char sigtoprog[MAXLINE] ; /* Prog recieving SIGUSR1 sig when */
- X /* a site goes critical */
- X
- X/*
- X * throughput -- finds throughput of a remote site
- X *
- X * parameters:
- X * addr is the address of the site to be tested. It can be either
- X * a name (e.g. phoenix.princeton.edu) or an IP # (e.g. 128.112.128.43)
- X * port is the port number, and defaults to 9 (discard port)
- X * numblocks is the number of blocks to send
- X * blocksize is the blocksize to be used
- X * pattern is a pattern of bytes which will be used to fill the data block
- X * (set it to NULL for random characters)
- X * time is the duration of the test in seconds
- X * verbose enables verbose output mode
- X *
- X * if both numblocks and time are nonzero, then the test will last until
- X * either numblocks blocks have been sent, or time seconds have elapsed,
- X * whichever comes first
- X *
- X * return values:
- X * a double representing the throughput in bits per second
- X * -1.0 if an error occured
- X */
- X
- Xdouble throughput(/* char *addr, short int port, long numbytes, int blocksize,
- X char *pattern, int time, int verbose */);
- X
- X#endif /* __TPMON__H__ */
- X
- X
- END_OF_FILE
- if test 3217 -ne `wc -c <'nocol-3.0/src/include/tpmon.h'`; then
- echo shar: \"'nocol-3.0/src/include/tpmon.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/include/tpmon.h'
- fi
- if test -f 'nocol-3.0/src/netmon/help_page.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/netmon/help_page.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/netmon/help_page.c'\" \(2760 characters\)
- sed "s/^X//" >'nocol-3.0/src/netmon/help_page.c' <<'END_OF_FILE'
- X/*+
- X** $Header
- X**/
- X
- X/* Copyright 1992 JvNCnet, Princeton */
- X
- X/*+
- X**
- X** FUNCTION:
- X** To display the help page by reading the file HELPFILE
- X**/
- X
- X/*
- X * $Log: help_page.c,v $
- X * Revision 1.4 1992/06/18 21:04:34 aggarwal
- X * Added copyright notice.
- X *
- X * Revision 1.3 1992/04/22 22:59:58 aggarwal
- X * Lot of cleaning up for releasing. Organized things right.
- X *
- X * Revision 1.2 1990/03/21 15:27:08 aggarwal
- X * replaced clrtoeol() with wclrtoeol(hwin)
- X *
- X * Revision 1.1 90/03/09 13:05:58 aggarwal
- X * Initial revision
- X *
- X *
- X */
- X
- X#include "netmon.h"
- X#include <sys/file.h>
- X
- X#ifndef HELPFILE
- X#define HELPFILE "helpfile"
- X#endif
- X#define WFULL(w) (w->_cury == (w->_maxy - 2)) ? 1:0
- X
- Xhelp_page()
- X{
- X extern int errno;
- X extern char *sys_errlist[];
- X extern char *helpfile ; /* In netmon.h */
- X WINDOW *hwin;
- X char buffer[MAXLINE], *strcat() ;
- X int i = 1, fd ;
- X
- X hwin= newwin( 0, 0, 0, 0 );
- X touchwin(hwin) ;
- X
- X help_title(hwin, i) ; /* display fancy title */
- X if ((fd = open(helpfile, O_RDONLY)) < 0)
- X {
- X wprintw(hwin,"Netmon help (open) %s: %s\n",
- X helpfile, sys_errlist[errno]);
- X wprintw(hwin, "\nHit any key to continue: ");
- X wclrtobot(hwin);
- X wrefresh(hwin);
- X getchar();
- X return(1);
- X }
- X
- X for ( ; ; ) /* display screenfuls of the helpfile */
- X {
- X while (!(WFULL(hwin)) && fdgets(buffer, MAXLINE, fd) != 0)
- X wprintw(hwin, "%s", buffer);
- X
- X if (WFULL(hwin)) /* window filled */
- X {
- X wprintw (hwin, "\n--More--");
- X wclrtoeol(hwin);
- X wrefresh(hwin);
- X if (getchar() == 'q')
- X break ; /* from outer 'for' */
- X }
- X else /* end of the file */
- X {
- X wprintw(hwin, "\nHit any key to return: ");
- X wclrtoeol(hwin);
- X wclrtobot(hwin); /* Remove old trash */
- X wrefresh(hwin) ;
- X getchar() ;
- X break ; /* from outer for loop */
- X }
- X werase(hwin);
- X help_title(hwin, ++i);
- X } /* end: for */
- X close(fd);
- X return(0); /* all OK */
- X
- X} /* end: help_page */
- X
- X
- Xhelp_title(hwin, hpage)
- X WINDOW *hwin;
- X int hpage;
- X{
- X wstandout (hwin);
- X mvwprintw (hwin, 0, (int)(COLS/2 - 6), "HELP SCREEN (%d)\n\n", hpage);
- X wstandend (hwin);
- X
- X return(1) ;
- X}
- X/*+
- X** FUNCTION:
- X** Read in a string from the open file desc. Keeps newline and
- X** appends a NULL at the end of the string
- X**/
- Xfdgets(buf, bufsiz, fd)
- X char *buf;
- X int bufsiz, fd;
- X{
- X register n, i = 0;
- X
- X if (bufsiz <= 0)
- X return(-1); /* invalid buffer size */
- X
- X while ((n = read(fd, &(buf[i]), 1)) > 0 && buf[i++] != '\n')
- X if (i == (bufsiz - 1))
- X break;
- X
- X buf[i] = '\0'; /* Append a null character */
- X if (n <= 0) /* No characters read */
- X return(0);
- X else
- X return(n) ; /* Num of characters read */
- X
- X} /* end: fdgets */
- END_OF_FILE
- if test 2760 -ne `wc -c <'nocol-3.0/src/netmon/help_page.c'`; then
- echo shar: \"'nocol-3.0/src/netmon/help_page.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/netmon/help_page.c'
- fi
- if test -f 'nocol-3.0/src/netmon/msg_dpy.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/netmon/msg_dpy.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/netmon/msg_dpy.c'\" \(3199 characters\)
- sed "s/^X//" >'nocol-3.0/src/netmon/msg_dpy.c' <<'END_OF_FILE'
- X/*+
- X** $Header: /home/aggarwal/lsrc/nocol/src/netmon/RCS/msg_dpy.c,v 1.7 1993/10/30 03:52:42 aggarwal Exp $
- X**/
- X
- X/* Copyright 1992 JvNCnet, Princeton */
- X
- X/*+
- X** This module displays messages on the 'wmsg' window. It displays all
- X** the files in the MSGSDIR directory.
- X** The window can scroll, so only the latest message is going to be shown
- X** anyway. For this very reason, make sure that the newlines when printing
- X** out strings are *before* the string starts and not afterwards (else
- X** the message can scroll off as soon as printed if the size of the
- X** message window is very small).
- X**
- X**/
- X
- X/*+
- X * $Log: msg_dpy.c,v $
- X * Revision 1.7 1993/10/30 03:52:42 aggarwal
- X * Now uses dirent(). Deleted include dir.h
- X *
- X * Revision 1.6 1992/06/18 21:05:02 aggarwal
- X * Small cleanups for releasing.
- X *
- X *
- X * Revision 1.4 1992/04/22 22:59:58 aggarwal
- X * Lot of cleaning up for releasing. Organized things right.
- X *
- X * Revision 1.3 1990/05/23 17:22:38 aggarwal
- X * Added control of the variable 'msg_on' so that it is turned
- X * off after displaying all the files in MSGDIR.
- X *
- X * Revision 1.2 90/05/13 16:24:00 aggarwal
- X * Removed the line to skip over "." and ".." since it is done
- X * in the fill_window module now.
- X *
- X * Revision 1.1 90/03/09 13:06:10 aggarwal
- X * Initial revision
- X *
- X *
- X */
- X
- X#include "netmon.h"
- X
- Xmsg_dpy ()
- X{
- X extern struct allwins aw ; /* In netmon.h */
- X extern int msg_on; /* In netmon.h */
- X extern char *msgsdir ; /* dir name, in netmon.h */
- X static DIR *msgdirp ; /* Ptr to 'msgs' dir */
- X static int msgfd ; /* Open file desc */
- X int display_one_msg() ;
- X
- X if (msgdirp == NULL) /* Not opened yet */
- X {
- X if ((msgdirp = opendir(msgsdir)) == NULL)
- X {
- X wprintw (aw.wmsg, "\n msg_dpy (opendir '%s'): %s",
- X msgsdir, sys_errlist[errno]);
- X return(1) ; /* 'minor' error */
- X }
- X }
- X
- X if (fill_window(aw.wmsg, msgdirp, MSGSDIR, &msgfd, display_one_msg))
- X {
- X closedir(msgdirp);
- X msgdirp = NULL ; /* reset to reopen dir */
- X msgfd = 0 ;
- X msg_on = 0 ; /* to skip this function next time */
- X }
- X
- X return(0);
- X
- X} /* end: msg_dpy() */
- X
- X/*+
- X** FUNCTION:
- X** Displays one line from the open file descriptor on the msg
- X** window. If reached the end of file, then returns a zero so that the
- X** calling program can close the file.
- X**
- X** Note that the function gets an opened file descriptor and it does
- X** not mess with the location of the file pointer since the next line
- X** is read from the previous location.
- X**
- X** The initial newline character should clear the present line to the
- X** end else the previous contents remain messed up. Hence used
- X** wclrtoeol() to make things safe and sound.
- X**/
- Xdisplay_one_msg(fd, wmsg)
- X int fd;
- X WINDOW *wmsg ;
- X{
- X char c ;
- X
- X waddch(wmsg, '\n'); /* Insert a newline first */
- X while (read(fd, &c, 1) > 0) /* read one character at a time */
- X if ( c == '\n') /* reached end of line */
- X {
- X wclrtoeol(wmsg); /* Clear prev stuff */
- X return(1); /* return to calling program */
- X }
- X else
- X waddch(wmsg, c); /* Put character onto screen */
- X
- X wclrtoeol(wmsg) ;
- X return (0); /* Here only if end of file */
- X}
- END_OF_FILE
- if test 3199 -ne `wc -c <'nocol-3.0/src/netmon/msg_dpy.c'`; then
- echo shar: \"'nocol-3.0/src/netmon/msg_dpy.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/netmon/msg_dpy.c'
- fi
- if test -f 'nocol-3.0/src/nsmon/poll_sites.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/nsmon/poll_sites.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/nsmon/poll_sites.c'\" \(2732 characters\)
- sed "s/^X//" >'nocol-3.0/src/nsmon/poll_sites.c' <<'END_OF_FILE'
- X/*
- X * $Header: /home/aggarwal/lsrc/nocol/src/nsmon/RCS/poll_sites.c,v 1.5 1993/10/30 03:41:25 aggarwal Exp $
- X *
- X * poll_sites.c for Nameserver monitor (nsmon)
- X * makes one pass over the entire data file
- X * adapted from poll_sites.c of pingmon 1.15
- X *
- X *
- X * $Log: poll_sites.c,v $
- X * Revision 1.5 1993/10/30 03:41:25 aggarwal
- X * *** empty log message ***
- X *
- X * Revision 1.4 1993/10/29 22:03:36 aggarwal
- X * Changed L_INCR to SEEK_CUR. Also deleted the wierd sockad.sin_addr.S_un
- X * stuff. Now passed the 'querydata' properly.
- X *
- X * Revision 1.3 1993/10/02 05:34:49 aggarwal
- X * Moved the 'logic' for escalating severity and updating the
- X * loglevel, etc. into a libnocol library routine.
- X *
- X * Revision 1.2 1993/09/18 22:37:16 aggarwal
- X * Added logging, etc.
- X *
- X * Revision 1.1 1992/06/11 05:06:12 aggarwal
- X * Initial revision
- X *
- X */
- X
- X/* Copyright 1993 JvNCnet, Global Enterprise Services */
- X
- X/*+
- X * INCLUDE FILES
- X */
- X
- X#include "nocol.h" /* common structures */
- X#include "nsmon.h" /* program specific defines */
- X
- X#include <signal.h>
- X#include <sys/file.h>
- X#include <arpa/nameser.h>
- X
- Xstatic int maxseverity = E_CRITICAL ; /* Max severity of events from nsmon */
- X
- X/* #defines for finish_status */
- X#define REACHED_EOF 1
- X#define READ_ERROR 2
- X
- Xpoll_sites(fdout)
- X int fdout; /* Descriptors to open files */
- X{
- X EVENT v; /* described in nocol.h */
- X struct tm *ltime ;
- X time_t locclock ; /* careful: don't use 'long' */
- X long status; /* site status */
- X int bufsize; /* for reading in file */
- X int sigpid; /* PID of program to get signal */
- X
- X if ( lseek(fdout, (off_t)0, SEEK_SET) == -1) { /* rewind the file */
- X perror (prognm);
- X return (-1);
- X }
- X
- X /*
- X * until end of the file or erroneous data... one entire pass
- X */
- X
- X while ( (bufsize = read (fdout, (char *)&v, sizeof(v))) == sizeof(v) )
- X {
- X switch(nsmon(v.site.addr, querydata, QUERYCLASS, QUERYTYPE,
- X QUERYTIMEOUT, QUERY_AA_ONLY, debug))
- X {
- X case ALL_OK: case NOT_AUTHORITATIVE:
- X status = 1; break; /* '1' for all OK */
- X case ERROR: default:
- X status = 0; break;
- X } /* switch */
- X
- X update_event(&v, status,/* VALUE */ status, maxseverity);
- X
- X /* Now rewind to start of present record and write to the file */
- X
- X lseek(fdout,-(off_t)sizeof(v), SEEK_CUR);
- X write (fdout, (char *)&v, sizeof(v));
- X
- X } /* end of: while (read..) */
- X
- X /**** Now determine why we broke out of the above loop *****/
- X
- X if (bufsize == 0) /* reached end of the file */
- X return (1);
- X else { /* error in output data file */
- X fprintf (stderr, "%s: Insufficient read data in output file", prognm);
- X return (-1);
- X }
- X} /* end of: poll_sites */
- X
- END_OF_FILE
- if test 2732 -ne `wc -c <'nocol-3.0/src/nsmon/poll_sites.c'`; then
- echo shar: \"'nocol-3.0/src/nsmon/poll_sites.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/nsmon/poll_sites.c'
- fi
- if test -f 'nocol-3.0/src/perlnocol/armon-confg' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/perlnocol/armon-confg'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/perlnocol/armon-confg'\" \(79 characters\)
- sed "s/^X//" >'nocol-3.0/src/perlnocol/armon-confg' <<'END_OF_FILE'
- X## Config for armon
- X#
- Xrouter=nomad
- X50-50 e0 GES: Sub50
- Xtest= 52 e0 GES: Sub50
- END_OF_FILE
- if test 79 -ne `wc -c <'nocol-3.0/src/perlnocol/armon-confg'`; then
- echo shar: \"'nocol-3.0/src/perlnocol/armon-confg'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/perlnocol/armon-confg'
- fi
- if test -f 'nocol-3.0/src/perlnocol/rcisco' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/perlnocol/rcisco'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/perlnocol/rcisco'\" \(3084 characters\)
- sed "s/^X//" >'nocol-3.0/src/perlnocol/rcisco' <<'END_OF_FILE'
- X#!/usr/local/bin/perl
- X#
- X# $Header: /home/aggarwal/lsrc/nocol/src/perlnocol/RCS/rcisco,v 1.3 1993/10/17 11:55:33 aggarwal Exp $
- X#
- X# rcisco - perl routine to execute a Cisco router command remotely
- X#
- X# Programmer: Christopher Sedore
- X# Revised by: John Wobus, jmwobus@mailbox.syr.edu
- X#
- X# (c) Syracuse University Computing & Network Services 1993
- X#
- X# No warranty is expressed or implied. Permission to copy and use is
- X# extended to all. Permission to redistribute is granted under the
- X# following conditions: it is not sold for profit; this copyright
- X# notice remains intact; the same permissions extend to the recipient;
- X# and if any changes are made, a notice is added so stating.
- X#
- X# Command Format:
- X#
- X# rcisco <router> <command> [<port>]
- X#
- X# Signs on to Cisco router, executes command, and returns the
- X# result.
- X#
- X# <router> - the name or IP number of the Cisco router.
- X# <command> - the Cisco router command, e.g. "show interfaces".
- X# <port> - the TCP port: 23 by default.
- X#
- X# Example Call:
- X#
- X# rcisco mycisco.excellent.edu "show hardware"
- X#
- X# This command signs on to myscisco.excellent.edu, executes the
- X# command "show hardware" and sends the result to the standard
- X# output.
- X#
- X# Depends upon:
- X# hostname - Unix command to list a host's name.
- X#
- X# To install this:
- X# (1) Assign the perl variables below appropriately.
- X# (2) Put this file whereever you want.
- X#
- X
- X#
- X
- X$defaultrouter="router.domain.edu"; # Default router.
- X$defaultpasswd="mypasswd"; # PW of the router.
- X$defaultcommand="show hardware"; # Command to exec on router
- X$defaultport=23; # Default TCP port.
- X
- X#
- X# main routine
- X#
- X
- X($them,$passwd,$command,$port) = @ARGV;
- X$them = $defaultrouter unless $them;
- X$passwd = $defaultpasswd unless $passwd;
- X$command = $defaultcommand unless $command;
- X$port = $defaultport unless $port; # usually should be port 23
- X
- X$AF_INET = 2;
- X$SOCK_STREAM = 1;
- X
- X$SIG{'INT'} = 'dokill';
- Xsub dokill { kill 9,$child if $child; }
- X
- X# require "$socketph";
- X
- X$sockaddr = 'S n a4 x8';
- Xchop($hostname = `hostname`);
- X
- X($name, $aliases, $proto) = getprotobyname('tcp');
- X($name, $aliases, $port) = getservbyname($port, 'tcp')
- X unless $port =~ /^\d+$/;
- X($name, $aliases, $type, $len, $thisaddr) =
- X gethostbyname($hostname);
- Xif ($them =~ /^\d+/) # IP address specified
- X{
- X local(@a) = split (/\./,$them);
- X $thataddr = pack ('C4', @a);
- X}
- Xelse {
- X ($name, $aliases, $type, $len, $thataddr) = gethostbyname($them);
- X}
- X
- X$thataddr || die "Unknown host: $!";
- X
- X$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
- X$that = pack($sockaddr, $AF_INET, $port, $thataddr);
- X
- Xsocket(S, $AF_INET, $SOCK_STREAM, $proto) || die "socket: $!";
- Xbind(S, $this) || die "bind: $!";
- Xconnect(S, $that) || die "connect: $!";
- X
- Xselect(S); $| = 1; select(STDOUT); # set socket to be command buffered
- X
- X
- Xif ($child = fork) {
- X print S "$passwd\n";
- X print S "terminal length 0\n"; # dont need a 'more'
- X sleep 1; #some routers work better with this.
- X print S "$command\n";
- X print S "quit\n";
- X sleep 3;
- X do dokill();
- X}
- Xelse {
- X while (<S>) {print;}
- X}
- END_OF_FILE
- if test 3084 -ne `wc -c <'nocol-3.0/src/perlnocol/rcisco'`; then
- echo shar: \"'nocol-3.0/src/perlnocol/rcisco'\" unpacked with wrong size!
- fi
- chmod +x 'nocol-3.0/src/perlnocol/rcisco'
- # end of 'nocol-3.0/src/perlnocol/rcisco'
- fi
- if test -f 'nocol-3.0/src/tpmon/poll_sites.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/tpmon/poll_sites.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/tpmon/poll_sites.c'\" \(3158 characters\)
- sed "s/^X//" >'nocol-3.0/src/tpmon/poll_sites.c' <<'END_OF_FILE'
- X
- X/*
- X * $Header: /home/aggarwal/lsrc/nocol/src/tpmon/RCS/poll_sites.c,v 1.4 1993/10/30 03:28:28 aggarwal Exp $
- X *
- X * FUNCTIONS:
- X * Test throughput to a site (NOCOL style).
- X *
- X * poll_sites.c -- makes one pass over the entire data file
- X *
- X * adapted from poll_sites.c of 'pingmon' 1.15
- X *
- X * AUTHOR
- X * S. Spencer Sun, JvNCnet, June 1992
- X *
- X * $Log: poll_sites.c,v $
- X * Revision 1.4 1993/10/30 03:28:28 aggarwal
- X * Deleted code for sending signal to watchdog. Now uses the
- X * libnocol.a update_event() call.
- X *
- X * Revision 1.3 1992/06/15 17:05:13 aggarwal
- X * Added '=' in the if(tp <= 0)
- X *
- X * Revision 1.2 1992/06/12 21:14:17 aggarwal
- X * Changed the bps returned by tpmon to Kbps.
- X *
- X * Revision 1.1 1992/06/12 04:07:29 aggarwal
- X * Initial revision
- X *
- X */
- X
- X/* Copyright 1992 JvNCnet, Princeton */
- X
- X
- X#include "nocol.h" /* common structures */
- X#include "tpmon.h" /* program specific defines */
- X
- X#include <signal.h>
- X#include <sys/file.h>
- X#include <arpa/nameser.h>
- X
- X/*
- X * Macro to escalate the severity of a site.
- X * Change E_CRITICAL to E_ERROR if you don't want this program to put
- X * events in the critical state.
- X */
- Xstatic int maxseverity = E_WARNING ; /* Max severity of events from tpmon */
- X
- X/* #defines for finish_status */
- X#define REACHED_EOF 1
- X#define READ_ERROR 2
- X
- Xpoll_sites(fdout)
- X int fdout; /* Descriptors to open files */
- X{
- X extern int debug; /* Enable debug (in pingmon.h) */
- X static FILE *p_cmd; /* for creating the ping cmd */
- X EVENT v; /* described in nocol.h */
- X char line[MAXLINE]; /* to create the ping command */
- X struct tm *ltime ;
- X time_t locclock ; /* careful: don't use 'long' */
- X long status; /* site status */
- X int bufsize; /* for reading in file */
- X long tp;
- X
- X if ( lseek(fdout, (off_t)0, L_SET) == -1) { /* rewind the file */
- X perror (prognm);
- X return (-1);
- X }
- X
- X /*
- X * until end of the file or erroneous data... one entire pass
- X */
- X
- X while ( (bufsize = read (fdout, (char *)&v, sizeof(v))) == sizeof(v) )
- X {
- X /* all these default parameters are #defined in tpmon.h */
- X tp = (long)throughput(v.site.addr, PORT_NUMBER, NUM_BYTES, BLOCKSIZE,
- X PATTERN, RUN_TIME, debug);
- X
- X tp = tp /1000L ; /* convert bits into Kbits */
- X
- X if (tp <= 0) /* some error occurred for this site */
- X {
- X v.nocop = SETF_UPDOUN(v.nocop, n_DOWN) ; /* mark as down, dont log */
- X continue; /* keep old value */
- X }
- X
- X /* Here if we have a thruput value */
- X
- X if (tp < v.var.threshold) /* if bad, then raise the severity */
- X status = 0;
- X else
- X status = 1;
- X update_event(&v, status, tp, maxseverity) ;
- X
- X /* Now rewind to start of present record and write to the file */
- X
- X lseek(fdout,-(off_t)sizeof(v), SEEK_CUR);
- X write (fdout, (char *)&v, sizeof(v));
- X
- X } /* end of: while (read..) */
- X
- X /*
- X * Now determine why we broke out of the above loop
- X */
- X
- X if (bufsize == 0) /* reached end of the file */
- X return (1);
- X else { /* error in output data file */
- X fprintf (stderr, "%s: Insufficient read data in output file", prognm);
- X return (-1);
- X }
- X} /* end of: poll_sites */
- X
- END_OF_FILE
- if test 3158 -ne `wc -c <'nocol-3.0/src/tpmon/poll_sites.c'`; then
- echo shar: \"'nocol-3.0/src/tpmon/poll_sites.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/tpmon/poll_sites.c'
- fi
- if test -f 'nocol-3.0/src/tpmon/tptest.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/tpmon/tptest.1'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/tpmon/tptest.1'\" \(2671 characters\)
- sed "s/^X//" >'nocol-3.0/src/tpmon/tptest.1' <<'END_OF_FILE'
- X.\"$Header: /nocol/src/tpmon/RCS/tptest.1,v 1.1 1992/06/18 21:22:15 aggarwal Exp $"
- X.TH TPTEST 1 "June 9, 1992"
- X.SH NAME
- X\fBtptest\fR \- testing program for \fBtpmon.c\fR C module
- X.SH SYNOPSIS
- X\fBtp\fR [ \fB-v\fR ] [ \fB-b \fInumbytes\fR ]
- X[ \fB-s \fIblock size\fR ]
- X[ \fB-t \fIseconds\fR ]
- X.if n .ti +0.25i
- X[ \fB-p \fIfill pattern\fR ] [ \fB-P \fIport number\fR ]
- X\fBhost\fR [ \fBhost ...\fR ]
- X.SH DESCRIPTION
- X\fBtptest\fR is a demonstration program to illustrate the usage of the
- X\fBthroughput()\fR function in \fBtpmon.c\fR so that you can use the
- X\fBthroughput()\fR function in your own programs, although I can't imagine
- Xwhy you would want to.
- X.PP
- XThe program measures throughput for each host listed on the command line on
- Xthe network by flooding the discard TCP port (usually port 9) with data.
- XIt keeps track of how much data it wrote and how long it took to write
- Xthis data and calculates the throughput in bits per second.
- X.PP
- XThe results may vary quite a bit depending on system load, so the
- Xthroughput figure reported by the program should not be regarded as being too
- Xreliable.
- X.SH OPTIONS
- X.TP 16
- X.B \-v
- Xselects verbose output mode
- X.TP
- X.BI "\-b " "numbytes"
- XNumber of bytes to send
- X.TP
- X.BI "\-s " "block size"
- XAttempt to send blocks that are \fIblock size\fR bytes long. Default is 1024.
- XNote that in order for the \fB-t\fR option to work properly, non-blocking
- XI/O has to be used, so that while the program \fItries\fR to send \fIblock
- Xsize\fR bytes with every call to \fBwrite(2)\fR, most of the time the actual
- Xnumber of bytes written will be less than that. Thus, changing the value
- Xdefault 1024) probably will not accomplish a whole lot. The parameter does
- Xdetermine the size of the block used in pattern filling, see \fB-p\fR option
- Xbelow.
- X.TP
- X.BI "\-t " seconds
- Xsend data for
- X.I seconds
- Xseconds. Note that this is probably not going to be accurate in any way
- Xbecause it uses
- X.B alarm(3)
- Xto interrupt the sending after
- X.I seconds
- Xseconds.
- X.TP
- X.BI "\-p " "fill pattern"
- Xrepeat
- X.I "fill pattern"
- Xto fill up the data block. For example, if
- X.I "block size"
- Xis 16 and
- X.I "fill pattern"
- Xis
- X.I foobar
- Xthen the data block will be
- X.IB "foobarfoobarfoob" "."
- X.TP
- X.BI "\-P " "port number"
- Xsend the data to socket port
- X.IB "port number" "."
- X.SH BUGS
- XIdeally if you give use both the \fB-b\fR and the \fB-t\fR options at
- Xthe same time, it should stop the test after \fInumbytes\fR bytes
- Xhave been sent, or \fIseconds\fR seconds have elapsed, whichever comes
- Xfirst. This may be implemented later, but currently if you specify
- Xboth options at once, the \fB-b\fR option is ignored.
- X.SH AUTHOR
- X.nf
- XS. Spencer Sun (spencer@phoenix.princeton.edu, spencer@jvnc.net)
- END_OF_FILE
- if test 2671 -ne `wc -c <'nocol-3.0/src/tpmon/tptest.1'`; then
- echo shar: \"'nocol-3.0/src/tpmon/tptest.1'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/tpmon/tptest.1'
- fi
- echo shar: End of archive 24 \(of 26\).
- cp /dev/null ark24isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 26 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-