home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-24 | 75.7 KB | 2,436 lines |
- Newsgroups: comp.sources.misc
- From: vikas@jvnc.net (Vikas Aggarwal)
- Subject: v40i155: nocol - Network Monitoring System, Part25/26
- Message-ID: <1993Nov24.163954.2175@sparky.sterling.com>
- X-Md4-Signature: e3ae664d8d96d7937bd03f36b5ddb529
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Organization: Sterling Software
- Date: Wed, 24 Nov 1993 16:39:54 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: vikas@jvnc.net (Vikas Aggarwal)
- Posting-number: Volume 40, Issue 155
- Archive-name: nocol/part25
- 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/cmu-snmp/apps/snmpnetstat/Makefile
- # nocol-3.0/src/cmu-snmp/include/asn1.h
- # nocol-3.0/src/cmu-snmp/include/snmp.h
- # nocol-3.0/src/cmu-snmp/include/snmp_client.h
- # nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip
- # nocol-3.0/src/cmu-snmp/snmplib/asn1.h
- # nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h
- # nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip
- # nocol-3.0/src/doc/nocol-utility.8 nocol-3.0/src/doc/nsmon.8
- # nocol-3.0/src/doc/portmon.8 nocol-3.0/src/genmon/Makefile
- # nocol-3.0/src/include/pingmon.h nocol-3.0/src/include/portmon.h
- # nocol-3.0/src/lib/Makefile nocol-3.0/src/lib/ftime.c
- # nocol-3.0/src/lib/putenv.c nocol-3.0/src/netmon/Makefile
- # nocol-3.0/src/netmon/nocol-help nocol-3.0/src/netmon/poll_input.c
- # nocol-3.0/src/noclog/Makefile nocol-3.0/src/nsmon/Makefile
- # nocol-3.0/src/nsmon/nsmon-confg nocol-3.0/src/nsmon/nstest.c
- # nocol-3.0/src/perlnocol/README nocol-3.0/src/portmon/Makefile
- # nocol-3.0/src/support/mping/msummary.dat
- # nocol-3.0/src/support/multiping/pingmisc.c
- # nocol-3.0/src/tpmon/Makefile nocol-3.0/src/tpmon/tptest.h
- # nocol-3.0/src/utility/keepalive_monitors
- # Wrapped by kent@sparky on Tue Nov 9 22:22:29 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 25 (of 26)."'
- if test -f 'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile'\" \(1283 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile' <<'END_OF_FILE'
- X#
- X# Copyright (c) 1987 Regents of the University of California.
- X# All rights reserved.
- X#
- X# Redistribution and use in source and binary forms are permitted
- X# provided that the above copyright notice and this paragraph are
- X# duplicated in all such forms and that any documentation,
- X# advertising materials, and other materials related to such
- X# distribution and use acknowledge that the software was developed
- X# by the University of California, Berkeley. The name of the
- X# University may not be used to endorse or promote products derived
- X# from this software without specific prior written permission.
- X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- X# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- X#
- X# @(#)Makefile 5.10 (Berkeley) 9/20/88
- X#
- XCFLAGS= -g -I../../include
- XLIBS= ../../lib/libsnmp.a
- XSRCS= inet.c if.c main.c route.c
- XOBJS= inet.o if.o main.o route.o
- X
- Xall: snmpnetstat
- X
- Xsnmpnetstat: ${OBJS} ${LIBS}
- X ${CC} -o $@ ${CFLAGS} ${OBJS} ${LIBS}
- X
- Xclean:
- X rm -f ${OBJS} core snmpnetstat
- X
- Xcleandir: clean
- X rm -f ${MAN} tags .depend
- X
- Xdepend: ${SRCS}
- X mkdep ${CFLAGS} ${SRCS}
- X
- Xlint: ${SRCS}
- X lint ${CFLAGS} ${SRCS}
- X
- Xtags: ${SRCS}
- X ctags ${SRCS}
- X
- Xinstall:
- X cp snmpnetstat ../../bin
- END_OF_FILE
- if test 1283 -ne `wc -c <'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/apps/snmpnetstat/Makefile'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/asn1.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/asn1.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/asn1.h'\" \(2415 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/asn1.h' <<'END_OF_FILE'
- X/*
- X * Definitions for Abstract Syntax Notation One, ASN.1
- X * As defined in ISO/IS 8824 and ISO/IS 8825
- 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#ifndef EIGHTBIT_SUBIDS
- Xtypedef u_long oid;
- X#define MAX_SUBID 0xFFFFFFFF
- X#else
- Xtypedef u_char oid;
- X#define MAX_SUBID 0xFF
- X#endif
- X
- X#define MAX_OID_LEN 64 /* max subid's in an oid */
- X
- X#define ASN_BOOLEAN (0x01)
- X#define ASN_INTEGER (0x02)
- X#define ASN_BIT_STR (0x03)
- X#define ASN_OCTET_STR (0x04)
- X#define ASN_NULL (0x05)
- X#define ASN_OBJECT_ID (0x06)
- X#define ASN_SEQUENCE (0x10)
- X#define ASN_SET (0x11)
- X
- X#define ASN_UNIVERSAL (0x00)
- X#define ASN_APPLICATION (0x40)
- X#define ASN_CONTEXT (0x80)
- X#define ASN_PRIVATE (0xC0)
- X
- X#define ASN_PRIMITIVE (0x00)
- X#define ASN_CONSTRUCTOR (0x20)
- X
- X#define ASN_LONG_LEN (0x80)
- X#define ASN_EXTENSION_ID (0x1F)
- X#define ASN_BIT8 (0x80)
- X
- X#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR)
- X#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
- X
- Xu_char *asn_parse_int();
- Xu_char *asn_build_int();
- Xu_char *asn_parse_string();
- Xu_char *asn_build_string();
- Xu_char *asn_parse_header();
- Xu_char *asn_build_header();
- Xu_char *asn_parse_length();
- Xu_char *asn_build_length();
- Xu_char *asn_parse_objid();
- Xu_char *asn_build_objid();
- Xu_char *asn_parse_null();
- Xu_char *asn_build_null();
- END_OF_FILE
- if test 2415 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/asn1.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/asn1.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/asn1.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/snmp.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/snmp.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/snmp.h'\" \(2082 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/snmp.h' <<'END_OF_FILE'
- X/*
- X * Definitions for the Simple Network Management Protocol (RFC 1067).
- 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#define SNMP_PORT 161
- X#define SNMP_TRAP_PORT 162
- X
- X#define SNMP_MAX_LEN 484
- X
- X#define SNMP_VERSION_1 0
- X
- X#define GET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
- X#define GETNEXT_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
- X#define GET_RSP_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
- X#define SET_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3)
- X#define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)
- X
- X#define SNMP_ERR_NOERROR (0x0)
- X#define SNMP_ERR_TOOBIG (0x1)
- X#define SNMP_ERR_NOSUCHNAME (0x2)
- X#define SNMP_ERR_BADVALUE (0x3)
- X#define SNMP_ERR_READONLY (0x4)
- X#define SNMP_ERR_GENERR (0x5)
- X
- X#define SNMP_TRAP_COLDSTART (0x0)
- X#define SNMP_TRAP_WARMSTART (0x1)
- X#define SNMP_TRAP_LINKDOWN (0x2)
- X#define SNMP_TRAP_LINKUP (0x3)
- X#define SNMP_TRAP_AUTHFAIL (0x4)
- X#define SNMP_TRAP_EGPNEIGHBORLOSS (0x5)
- X#define SNMP_TRAP_ENTERPRISESPECIFIC (0x6)
- X
- END_OF_FILE
- if test 2082 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/snmp.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/snmp.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/snmp.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/snmp_client.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/snmp_client.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/snmp_client.h'\" \(1453 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/snmp_client.h' <<'END_OF_FILE'
- X/*
- X * snmp_client.h
- 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******************************************************************/
- Xstruct synch_state {
- X int waiting;
- X int status;
- X/* status codes */
- X#define STAT_SUCCESS 0
- X#define STAT_ERROR 1
- X#define STAT_TIMEOUT 2
- X int reqid;
- X struct snmp_pdu *pdu;
- X};
- X
- Xextern struct synch_state snmp_synch_state;
- X
- Xstruct snmp_pdu *snmp_pdu_create();
- Xstruct snmp_pdu *snmp_fix_pdu();
- Xchar *snmp_errstring();
- END_OF_FILE
- if test 1453 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/snmp_client.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/snmp_client.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/snmp_client.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip'\" \(1789 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip' <<'END_OF_FILE'
- X/*
- X * Definitions for SNMP (RFC 1067) agent variable finder.
- 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#define MAX_INTERFACES 2
- Xextern struct mib_ifEntry mib_ifEntry[MAX_INTERFACES];
- Xextern struct mib_ip mib_ip;
- X#define ROUTE_ENTRIES 2
- Xextern struct mib_udp mib_udp;
- Xextern long mib_icmpInMsgs;
- Xextern long mib_icmpOutMsgs;
- Xextern long mib_icmpInErrors; /* not checked in KIP */
- Xextern long mib_icmpOutErrors; /* not checked in KIP */
- Xextern long mib_icmpInCount[];
- Xextern long mib_icmpOutCount[];
- X
- Xu_char *var_system();
- Xu_char *var_ifEntry();
- Xu_char *var_atEntry();
- Xu_char *var_ip();
- Xu_char *var_ipAddrEntry();
- Xu_char *var_ipRouteEntry();
- Xu_char *var_icmp();
- Xu_char *var_udp();
- Xu_char *getStatPtr();
- X
- X
- END_OF_FILE
- if test 1789 -ne `wc -c <'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/include/snmp_vars.h.kip'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/asn1.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/asn1.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/asn1.h'\" \(2415 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/asn1.h' <<'END_OF_FILE'
- X/*
- X * Definitions for Abstract Syntax Notation One, ASN.1
- X * As defined in ISO/IS 8824 and ISO/IS 8825
- 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#ifndef EIGHTBIT_SUBIDS
- Xtypedef u_long oid;
- X#define MAX_SUBID 0xFFFFFFFF
- X#else
- Xtypedef u_char oid;
- X#define MAX_SUBID 0xFF
- X#endif
- X
- X#define MAX_OID_LEN 64 /* max subid's in an oid */
- X
- X#define ASN_BOOLEAN (0x01)
- X#define ASN_INTEGER (0x02)
- X#define ASN_BIT_STR (0x03)
- X#define ASN_OCTET_STR (0x04)
- X#define ASN_NULL (0x05)
- X#define ASN_OBJECT_ID (0x06)
- X#define ASN_SEQUENCE (0x10)
- X#define ASN_SET (0x11)
- X
- X#define ASN_UNIVERSAL (0x00)
- X#define ASN_APPLICATION (0x40)
- X#define ASN_CONTEXT (0x80)
- X#define ASN_PRIVATE (0xC0)
- X
- X#define ASN_PRIMITIVE (0x00)
- X#define ASN_CONSTRUCTOR (0x20)
- X
- X#define ASN_LONG_LEN (0x80)
- X#define ASN_EXTENSION_ID (0x1F)
- X#define ASN_BIT8 (0x80)
- X
- X#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR)
- X#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
- X
- Xu_char *asn_parse_int();
- Xu_char *asn_build_int();
- Xu_char *asn_parse_string();
- Xu_char *asn_build_string();
- Xu_char *asn_parse_header();
- Xu_char *asn_build_header();
- Xu_char *asn_parse_length();
- Xu_char *asn_build_length();
- Xu_char *asn_parse_objid();
- Xu_char *asn_build_objid();
- Xu_char *asn_parse_null();
- Xu_char *asn_build_null();
- END_OF_FILE
- if test 2415 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/asn1.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/asn1.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/asn1.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h'\" \(1453 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h' <<'END_OF_FILE'
- X/*
- X * snmp_client.h
- 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******************************************************************/
- Xstruct synch_state {
- X int waiting;
- X int status;
- X/* status codes */
- X#define STAT_SUCCESS 0
- X#define STAT_ERROR 1
- X#define STAT_TIMEOUT 2
- X int reqid;
- X struct snmp_pdu *pdu;
- X};
- X
- Xextern struct synch_state snmp_synch_state;
- X
- Xstruct snmp_pdu *snmp_pdu_create();
- Xstruct snmp_pdu *snmp_fix_pdu();
- Xchar *snmp_errstring();
- END_OF_FILE
- if test 1453 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/snmp_client.h'
- fi
- if test -f 'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip'\" \(1789 characters\)
- sed "s/^X//" >'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip' <<'END_OF_FILE'
- X/*
- X * Definitions for SNMP (RFC 1067) agent variable finder.
- 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#define MAX_INTERFACES 2
- Xextern struct mib_ifEntry mib_ifEntry[MAX_INTERFACES];
- Xextern struct mib_ip mib_ip;
- X#define ROUTE_ENTRIES 2
- Xextern struct mib_udp mib_udp;
- Xextern long mib_icmpInMsgs;
- Xextern long mib_icmpOutMsgs;
- Xextern long mib_icmpInErrors; /* not checked in KIP */
- Xextern long mib_icmpOutErrors; /* not checked in KIP */
- Xextern long mib_icmpInCount[];
- Xextern long mib_icmpOutCount[];
- X
- Xu_char *var_system();
- Xu_char *var_ifEntry();
- Xu_char *var_atEntry();
- Xu_char *var_ip();
- Xu_char *var_ipAddrEntry();
- Xu_char *var_ipRouteEntry();
- Xu_char *var_icmp();
- Xu_char *var_udp();
- Xu_char *getStatPtr();
- X
- X
- END_OF_FILE
- if test 1789 -ne `wc -c <'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip'`; then
- echo shar: \"'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/cmu-snmp/snmplib/snmp_vars.h.kip'
- fi
- if test -f 'nocol-3.0/src/doc/nocol-utility.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/nocol-utility.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/nocol-utility.8'\" \(1276 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/nocol-utility.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/nocol-utility.8,v 1.1 1993/10/28 16:38:03 aggarwal Exp $"
- X.\"
- X.TH NOCOL-UTILITY 8 "Oct 1, 1993
- X.SH NAME
- XMiscellanous nocol utility programs.
- X.SH DESCRIPTION
- X.LP
- XThere are a number of utility programs for NOCOL. These are described
- Xbelow:
- X.RS
- X.IP keepalive_monitors
- XThis is a simple shell script which makes sure that the various nocol
- Xmonitors are running and if not, restarts them. Edit the script and
- Xconfigure the various variables like who gets email when a monitor
- Xis restarted, which host should run which monitor, etc.
- X.IP notifier
- XThis is a simple example of how people can be notified (or problems
- Xescalated) when sites are in critical condition for extended periods
- Xof time. It uses the
- X.I eventselect
- Xprogram to specify the time window and the severity and then sends email
- X(but it could as easily do troubleshooting or page someone).
- X.IP display_nocol_datafile
- XThis program can be used to display a NOCOL format datafile (specified
- Xon the command line).
- X.RE
- X.\"------------------------------------
- X.SH AUTHOR
- XVikas Aggarwal, 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 1276 -ne `wc -c <'nocol-3.0/src/doc/nocol-utility.8'`; then
- echo shar: \"'nocol-3.0/src/doc/nocol-utility.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/nocol-utility.8'
- fi
- if test -f 'nocol-3.0/src/doc/nsmon.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/nsmon.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/nsmon.8'\" \(2327 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/nsmon.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/nsmon.8,v 1.4 1993/10/30 03:10:51 aggarwal Exp $"
- X.\"
- X.TH NSMON 8 "June 9, 1992"
- X.SH NAME
- Xnsmon \- Nameserver monitor
- X.SH SYNOPSIS
- X.B nsmon
- X[
- X.B \-d
- X] [
- X.B \-o
- X.I output-file
- X]
- X.I config-file
- X.SH DESCRIPTION
- X.LP
- X.B nsmon
- Xis part of the NOCOL network monitoring package from JvNCnet, used for
- Xtesting the nameserver status
- X.RI ( named
- X) for a list of hosts.
- X
- XThe program reads in the list of sites to test from a config file at startup
- Xand then does a nameserver query from the hosts periodically. If the server
- Xdoes not resolve the query, the
- X.I named
- Xprocess is assumed to be down or unavailable and a CRITICAL message is logged
- Xin the output file.
- X
- XThe query type is SOA. Other resolver options set in the query are
- XRES_RECURSE off (no recursion), RES_DNSRCH off
- X(parent, etc not searched) and RES_AAONLY (only accept authoritative
- Xanswers). Note however, that the server implementation may choose to ignore
- Xany of these options.
- XThe servers are queried every POLLINTERVAL (default 60) seconds.
- 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 queried for the nameserver.
- XThe format of this file is:
- X.RS
- X.sp
- X.DS
- XPOLLINTERVAL secs
- X.br
- XDOMAINNAME name-string
- X.br
- X<SiteName> <IPaddress>
- X.DE
- X.RE
- X.sp
- X.IP
- XThe
- X.I sitename
- Xis only for the operator's benefit and thus does not have to be a full
- Xinternet name. The second column is the site's IP address.
- X.\"------------------------------------
- X.SH AUTHOR
- XS. Spencer Sun (spencer@phoenix.princeton.edu) for JvNCnet.
- X.SH CAVEATS
- XThe program uses the low level
- X.B res_mkquery
- Xcall for querying the nameserver. Unfortunately, discrepancies in the data
- Xstructures exist between vendors, so slight modifications to the source might
- Xbe necessary on some systems.
- X.LP
- XThe server queried can choose to ignore the various flags (like NORECURSIVE,
- XAAONLY) that the client sets in the query.
- 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 2327 -ne `wc -c <'nocol-3.0/src/doc/nsmon.8'`; then
- echo shar: \"'nocol-3.0/src/doc/nsmon.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/nsmon.8'
- fi
- if test -f 'nocol-3.0/src/doc/portmon.8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/doc/portmon.8'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/doc/portmon.8'\" \(2071 characters\)
- sed "s/^X//" >'nocol-3.0/src/doc/portmon.8' <<'END_OF_FILE'
- X.\"$Header: /home/aggarwal/lsrc/nocol/src/doc/RCS/portmon.8,v 1.1 1993/10/28 16:38:03 aggarwal Exp $
- X.\"
- X.TH PORTMON 8 "October 1, 1993"
- X.SH NAME
- Xportmon \- NOCOL monitor for TCP ports.
- X.SH SYNOPSIS
- X.B portmon
- X[
- X.B \-d
- X.I (debug)
- X] [
- X.B \-f
- X.I <config-file>
- X]
- X.\"
- X.SH DESCRIPTION
- X.LP
- X.B portmon
- Xconnects to a list of specified TCP ports on specified systems and
- Xchecks to see if connections are accepted on the port. It can send
- Xa string and then parse the output against a list of responses. Each
- Xresponse can be assigned a severity level.
- X
- X.SH CONFIG FILE
- XThe configuration file format is:
- X.RS
- X.sp .5
- X.nf
- X# Config file for portmon nocol monitor
- X#
- X# Order is important... the first substring match will return and NOT
- X# test the remaining strings.
- X#
- X# Format:
- X# POLLINTERVAL 600
- X# HOST <name> <addr> <variable> <port#> <failseverity> [send-string]
- X# [maxseverity response]
- X# [maxseverity response]
- X# HOST ....
- X# Severity levels are: critical | error | warning | info
- X##
- XPOLLINTERVAL 3600
- X#
- X# for innd. Checking for 'no space' 'expire running' 'bad article file'
- XHOST c3po 192.41.171.5 NEWSport 119 Critical
- Xcrit space
- Xinfo expire
- Xcrit Cannot write active
- Xinfo posting ok
- X#
- XHOST nisc 128.121.50.7 SMTPport 25 Critical helo
- Xinfo 250
- X#
- X.fi
- X.RE
- X.LP
- XThe program checks for sub-strings in the responses, and is case sensiive.
- XThe first match returns, and the remaining list of responses is not tested.
- XThe
- X.I send-string
- Xis optional, and the initial connect response is discarded if this is
- Xpresent.
- XThe
- X.I default-severity
- Xis the severity if none of the responses match or if a connect fails.
- XThe severity is escalated in each pass until they reach the levels
- Xspecified in the config file.
- X.\"------------------------------------
- X.SH CAVEATS
- XThe response strings and match tests are case sensitive (done using
- X.I strstr()
- Xlibrary call).
- 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 2071 -ne `wc -c <'nocol-3.0/src/doc/portmon.8'`; then
- echo shar: \"'nocol-3.0/src/doc/portmon.8'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/doc/portmon.8'
- fi
- if test -f 'nocol-3.0/src/genmon/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/genmon/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/genmon/Makefile'\" \(1416 characters\)
- sed "s/^X//" >'nocol-3.0/src/genmon/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.2 1993/10/30 03:19:34 aggarwal Exp $
- X#
- X# Makefile for 'nocold'
- X#
- X#
- X
- X## SET THIS
- X# Directories needed by the Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- XINSTALL = install
- X
- X## SET THIS
- X# Directories needed during compile time
- X# DATADIR location of nocol data files
- X#
- XDATADIR = $(TOP)/data
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- XSYSDEFS =
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DDATADIR=\"$(DATADIR)\"
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -I../include -L$(LIBDIR) -L../lib
- X
- XTARG = genmon
- XOBJECTS = genmon.o
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h
- X
- Xinstall: $(TARG)
- X @[ -d $(TOP) ] || mkdir $(TOP)
- X @[ -d $(ETCDIR) ] || mkdir $(ETCDIR)
- X @[ -d $(BINDIR) ] || mkdir $(BINDIR)
- X $(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
- X
- Xclean:
- X /bin/rm -f $(OBJECTS) $(TARG) *.o core a.out
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- X
- END_OF_FILE
- if test 1416 -ne `wc -c <'nocol-3.0/src/genmon/Makefile'`; then
- echo shar: \"'nocol-3.0/src/genmon/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/genmon/Makefile'
- fi
- if test -f 'nocol-3.0/src/include/pingmon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/include/pingmon.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/include/pingmon.h'\" \(2450 characters\)
- sed "s/^X//" >'nocol-3.0/src/include/pingmon.h' <<'END_OF_FILE'
- X/*
- X** $Header: /home/aggarwal/lsrc/nocol/src/include/RCS/pingmon.h,v 1.12 1993/10/30 03:04:17 aggarwal Exp $
- X*/
- X
- X#include "nocol.h"
- 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/ipnodes"
- X#endif
- X
- X/*
- X * If using IP, then you might like to use the 'multiping' program which
- X * pings multiple sites synchronously. If defined, it defines the PING
- X * value also.
- X */
- X#ifndef IP
- X# undef MULTIPING /* undef so poll_sites.c okay */
- X#endif /* IP */
- X
- X#ifdef MULTIPING
- X# ifndef BATCHSIZE
- X# define BATCHSIZE 32 /* number of sites to ping at a time */
- X# endif /* less than limit MAXBATCH in multiping.c */
- X# ifndef PING
- X# define PING "multiping" /* the multi ping command to use */
- X# endif /* PING */
- X#else
- X# define BATCHSIZE 1 /* for standard ping programs */
- X#endif /* MULTIPING */
- X
- 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 "pingmon" /* */
- X
- X
- X/*************** Rest is standard and need not be touched ***********/
- X
- X#ifndef PING
- X# ifdef sun
- X# define PING "/usr/etc/ping"
- X# else
- X# define PING "/etc/ping"
- X# endif /* sun */
- X#endif /* PING */
- X
- X/*
- X * Extension of the output datafile. DATADIR/prognm is tacked onto this name.
- X */
- X#define PINGOUTPUTEXT "-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#define DATALEN 100 /* Size of ping packets (bytes) */
- X#define NPACKETS 10 /* Number of ping packets sent */
- X#define PING_THRES 3 /* If more than this pkts lost, then down */
- X#define POLLINTERVAL 180 /* secs between starting next poll */
- X
- X#define VARNM "Reachability" /* for EVENT.var.name field */
- X#define VARUNITS "Pkts" /* Units name */
- X#define DEBUG_FLG "NOCOL_DEBUG" /* to run in debug mode if set */
- X
- X/*
- X * Global variables
- X */
- Xint debug ;
- Xchar *prognm ; /* Program name */
- Xchar *sender ; /* Name used in the v.sender field */
- Xchar *ping ; /* which ping to use */
- X
- END_OF_FILE
- if test 2450 -ne `wc -c <'nocol-3.0/src/include/pingmon.h'`; then
- echo shar: \"'nocol-3.0/src/include/pingmon.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/include/pingmon.h'
- fi
- if test -f 'nocol-3.0/src/include/portmon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/include/portmon.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/include/portmon.h'\" \(1384 characters\)
- sed "s/^X//" >'nocol-3.0/src/include/portmon.h' <<'END_OF_FILE'
- X/* $Header: /home/aggarwal/lsrc/nocol/src/include/RCS/portmon.h,v 1.1 1993/10/30 03:04:41 aggarwal Exp $ */
- X
- X#include "nocol.h"
- X
- X#include <sys/types.h>
- X#include <stdio.h>
- X#include <string.h>
- X#include <ctype.h>
- X#include <errno.h>
- X
- X#include <unistd.h> /* for lseek */
- X#include <sys/file.h>
- X#include <sys/stat.h>
- X#include <fcntl.h>
- X
- X#include <sys/socket.h>
- X#include <sys/un.h>
- X#include <sys/wait.h>
- X#include <sys/time.h>
- X#include <signal.h>
- X#include <netdb.h>
- X
- X
- X#ifndef ETCDIR
- X# define ETCDIR "../../etc"
- X#endif
- X
- X#ifndef DATADIR
- X# define DATADIR "../../data"
- X#endif
- X
- X#ifndef CONFIGFILE
- X# define CONFIGFILE "../../etc/portmon-confg"
- X#endif
- X
- X#define OUTPUTEXT "-output"
- X#define VARUNITS "Port"
- X
- X#define MAXLINE 128 /* Randomly selected string length */
- X#define MAXHOSTS 128
- X#define TIMEOUT 30 /* secs in 'connect' timeouts */
- X#define POLLINTERVAL 60*15 /* seconds between passes */
- X
- X
- Xstruct _response
- X{
- X char *response;
- X int severity;
- X} ;
- X
- Xstruct _harray
- X{
- X char *hname ; /* Name for nocol struct */
- X char *ipaddr ; /* IP name (or address) */
- X char *send ; /* string to send remote site */
- X int port ; /* port number being tested */
- X int maxseverity ;
- X struct _response responses[20] ; /* max number of chat strings */
- X} hostarray[MAXHOSTS] ;
- X
- X
- X#define RTIMEOUT 60 /* seconds for socket read() timeout */
- X
- END_OF_FILE
- if test 1384 -ne `wc -c <'nocol-3.0/src/include/portmon.h'`; then
- echo shar: \"'nocol-3.0/src/include/portmon.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/include/portmon.h'
- fi
- if test -f 'nocol-3.0/src/lib/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/lib/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/lib/Makefile'\" \(1348 characters\)
- sed "s/^X//" >'nocol-3.0/src/lib/Makefile' <<'END_OF_FILE'
- X#
- X# Makefile for nocol lib
- X#
- X
- X## SET THIS
- X# Directories needed by the Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# NLOG_HOST host where the noclogd logging daemon runs
- X#
- XNLOG_HOST = noclog.jvnc.net
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- XSYSDEFS =
- XRANLIB = ranlib
- XINSTALL = install
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DNLOG_HOST=\"$(NLOG_HOST)\"
- X
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XCFLAGS = -g -I$(INCLUDEDIR) -I../include
- X
- XTARG = libnocol.a
- XOBJS= eventlog.o event_utils.o fgetline.o getdate.o standalone.o $(NEEDOBJS)
- X
- X$(TARG): $(OBJS)
- X /bin/rm -f $(TARG)
- X ar r $(TARG) $(OBJS)
- X $(RANLIB) $(TARG)
- X @echo "Created $(TARG) in `pwd`"
- X
- X## For testing, to make a standalone version using -DTEST
- Xgetdate: getdate.y
- X @/bin/rm -f y.tab.c
- X yacc getdate.y
- X cc $(CFLAGS) -DTEST y.tab.c -o $@
- X @/bin/rm -f y.tab.c
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/noclogd.h
- X
- Xinstall: $(TARG)
- X
- Xclean:
- X rm -f $(OBJS) $(TARG) core a.out getdate
- END_OF_FILE
- if test 1348 -ne `wc -c <'nocol-3.0/src/lib/Makefile'`; then
- echo shar: \"'nocol-3.0/src/lib/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/lib/Makefile'
- fi
- if test -f 'nocol-3.0/src/lib/ftime.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/lib/ftime.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/lib/ftime.c'\" \(2339 characters\)
- sed "s/^X//" >'nocol-3.0/src/lib/ftime.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1980, 1991 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#ifndef lint
- Xstatic char rcsid[] = "ftime.c,v 1.2 1993/08/02 17:50:05 mycroft Exp";
- X#endif /* not lint */
- X
- X#include <sys/types.h>
- X#include <sys/time.h>
- X#include <sys/timeb.h>
- X
- Xftime(tbp)
- X struct timeb *tbp;
- X{
- X struct timezone tz;
- X struct timeval t;
- X
- X if (gettimeofday(&t, &tz) < 0)
- X return (-1);
- X tbp->millitm = t.tv_usec / 1000;
- X tbp->time = t.tv_sec;
- X tbp->timezone = tz.tz_minuteswest;
- X tbp->dstflag = tz.tz_dsttime;
- X
- X return (0);
- X}
- END_OF_FILE
- if test 2339 -ne `wc -c <'nocol-3.0/src/lib/ftime.c'`; then
- echo shar: \"'nocol-3.0/src/lib/ftime.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/lib/ftime.c'
- fi
- if test -f 'nocol-3.0/src/lib/putenv.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/lib/putenv.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/lib/putenv.c'\" \(2015 characters\)
- sed "s/^X//" >'nocol-3.0/src/lib/putenv.c' <<'END_OF_FILE'
- X/* @(#)putenv.c 1.2 */
- X/* LINTLIBRARY */
- X/* putenv - change environment variables
- X
- X input - char *change = a pointer to a string of the form
- X "name=value"
- X
- X output - 0, if successful
- X 1, otherwise
- X*/
- X#define NULL 0
- Xextern char **environ; /* pointer to enviroment */
- Xstatic reall = 0; /* flag to reallocate space, if putenv is called
- X more than once */
- X
- Xint
- Xputenv(change)
- Xchar *change;
- X{
- X char **newenv; /* points to new environment */
- X register int which; /* index of variable to replace */
- X char *realloc(), *malloc(); /* memory alloc routines */
- X
- X if ((which = find(change)) < 0) {
- X /* if a new variable */
- X /* which is negative of table size, so invert and
- X count new element */
- X which = (-which) + 1;
- X if (reall) {
- X /* we have expanded environ before */
- X newenv = (char **)realloc(environ,
- X which*sizeof(char *));
- X if (newenv == NULL) return -1;
- X /* now that we have space, change environ */
- X environ = newenv;
- X } else {
- X /* environ points to the original space */
- X reall++;
- X newenv = (char **)malloc(which*sizeof(char *));
- X if (newenv == NULL) return -1;
- X (void)memcpy((char *)newenv, (char *)environ,
- X (int)(which*sizeof(char *)));
- X environ = newenv;
- X }
- X environ[which-2] = change;
- X environ[which-1] = NULL;
- X } else {
- X /* we are replacing an old variable */
- X environ[which] = change;
- X }
- X return 0;
- X}
- X
- X/* find - find where s2 is in environ
- X *
- X * input - str = string of form name=value
- X *
- X * output - index of name in environ that matches "name"
- X * -size of table, if none exists
- X*/
- Xstatic
- Xfind(str)
- Xregister char *str;
- X{
- X register int ct = 0; /* index into environ */
- X
- X while(environ[ct] != NULL) {
- X if (match(environ[ct], str) != 0)
- X return ct;
- X ct++;
- X }
- X return -(++ct);
- X}
- X/*
- X * s1 is either name, or name=value
- X * s2 is name=value
- X * if names match, return value of 1,
- X * else return 0
- X */
- X
- Xstatic
- Xmatch(s1, s2)
- Xregister char *s1, *s2;
- X{
- X while(*s1 == *s2++) {
- X if (*s1 == '=')
- X return 1;
- X s1++;
- X }
- X return 0;
- X}
- END_OF_FILE
- if test 2015 -ne `wc -c <'nocol-3.0/src/lib/putenv.c'`; then
- echo shar: \"'nocol-3.0/src/lib/putenv.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/lib/putenv.c'
- fi
- if test -f 'nocol-3.0/src/netmon/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/netmon/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/netmon/Makefile'\" \(1871 characters\)
- sed "s/^X//" >'nocol-3.0/src/netmon/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.5 1993/10/30 03:49:49 aggarwal Exp $
- X#
- X# Makefile for 'netmon'
- X#
- X#
- X# ETC is used for dumping the HELPFILE in that directory
- X
- X## SET THIS
- X# Directories needed by the Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# Directories needed by the program.
- XDATADIR = $(TOP)/data
- XMSGSDIR = $(TOP)/msgs
- XHELPFILE = $(ETCDIR)/nocol-help
- X
- X## SET THIS
- X# The special system definitions. Define:
- X# -DNETLOG If you want to enable invoking netlog from
- X# within 'netmon'
- XSYSDEFS =
- XINSTALL = install
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DDATADIR=\"$(DATADIR)\" \
- X -DMSGSDIR=\"$(MSGSDIR)\" \
- X -DHELPFILE=\"$(HELPFILE)\"
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lcurses -ltermcap -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -L$(LIBDIR)
- X
- XTARG = netmon
- XOBJECTS = build_display.o event_dpy.o fill_window.o filter.o \
- X help_page.o msg_dpy.o netmon.o parse_input.o \
- X poll_input.o read_filter.o setup_display.o utils.o
- X
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/netmon.h
- X
- Xinstall: netmon
- X @[ -d $(TOP) ] || mkdir $(TOP)
- X @[ -d $(DATADIR) ] || mkdir $(DATADIR)
- X @[ -d $(ETCDIR) ] || mkdir $(ETCDIR)
- X @[ -d $(BINDIR) ] || mkdir $(BINDIR)
- X @-[ -d $(MSGSDIR) ] || mkdir $(MSGSDIR)
- X $(INSTALL) -c -m 751 netmon $(BINDIR)/nocol
- X $(INSTALL) -c -m 0444 nocol-help $(HELPFILE)
- X
- X
- Xclean:
- X /bin/rm -f $(OBJECTS) $(TARG) core a.out
- X
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- X
- END_OF_FILE
- if test 1871 -ne `wc -c <'nocol-3.0/src/netmon/Makefile'`; then
- echo shar: \"'nocol-3.0/src/netmon/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/netmon/Makefile'
- fi
- if test -f 'nocol-3.0/src/netmon/nocol-help' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/netmon/nocol-help'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/netmon/nocol-help'\" \(1995 characters\)
- sed "s/^X//" >'nocol-3.0/src/netmon/nocol-help' <<'END_OF_FILE'
- XThis program displays the output from various Network monitoring programs.
- XIt displays the value of monitored variables and their state.
- X
- X USAGE: nocol [-d (debug)] [-q (quiet)] [-w (wide display)]
- X [-l <level 1:4>] [alternate data directory]
- X
- XPrompt options:
- X
- X b - Bell on/off (toggle)
- X c - Contract size of event display screen
- X d - Debug mode (toggle)
- X f - Freeze screen (toggle)
- X h - help screen (this display)
- X l <level> - set new display Level (from 1 to 4)
- X q - Quit
- X r - Refresh screen
- X s or / - Search filter on event screen
- X x - eXpand size of event display screen
- X w - toggle Wide display mode
- X any key - for next screen
- X
- XThe User Screen:
- X---------------
- XThe screen is divided into two sections- the EVENT section and the MESSAGES
- Xsection. All site events are displayed in the EVENT section and any text
- Xmessages are displayed in the MESSAGES section. These messages are displayed
- Xin rotation and scroll in each screenful.
- X
- XBy default the screen is updated every 15 seconds. However, by using
- Xthe 'freeze' option, the screen is updated only when the user hits
- Xa key.
- X
- XThe size of the 'event' window can be manipulated using the 'c' and
- X'x' options. The message window grows correspondingly larger as
- Xthe event window shrinks in size.
- X
- XOutput Display Filter
- X---------------------
- XThe output for the events can be filtered and only events matching a string
- Xbe displayed on the screen. The syntax of the search pattern is:
- X
- X word1 & word2 | word3
- X
- Xso that only the events that have 'word1' and 'word2' (both together) OR
- Xword3 will be displayed. Regular expressions are not supported. All words
- Xare converted to lowercase for case insensetive matching.
- X
- X
- XTerminal Type
- X-------------
- XIf your terminal type is unsuitable, you are prompted for the type
- Xwhen you start the program. Common terminal types are:
- X
- X vt100, vtxxx DEC terminals
- X vt100-w, vt200-w DEC terminals in 132 col mode
- X xterm for X window terminal emulator
- X
- XMail comments / suggestions to nocol@jvnc.net
- END_OF_FILE
- if test 1995 -ne `wc -c <'nocol-3.0/src/netmon/nocol-help'`; then
- echo shar: \"'nocol-3.0/src/netmon/nocol-help'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/netmon/nocol-help'
- fi
- if test -f 'nocol-3.0/src/netmon/poll_input.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/netmon/poll_input.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/netmon/poll_input.c'\" \(1744 characters\)
- sed "s/^X//" >'nocol-3.0/src/netmon/poll_input.c' <<'END_OF_FILE'
- X/*+
- X** $Header: /home/aggarwal/lsrc/nocol/src/netmon/RCS/poll_input.c,v 1.5 1993/10/30 03:53:49 aggarwal Exp $
- X**/
- X
- X/* Copyright 1993 JvNCnet, Global Enterprise Services */
- X
- X/*+
- X**
- X** FUNCTION:
- X** It polls for the user input asynchronously and returns the
- X** user input (integer = character). If there is no user input for as
- X** long as PAUSE (defined in the netmon.h include file), it returns a
- X** '0' value.
- X**
- X** Uses the 'select' function.
- X**
- X** AUTHOR
- X** Vikas Aggarwal
- X**
- X**/
- X
- X/*+
- X * $Log: poll_input.c,v $
- X * Revision 1.5 1993/10/30 03:53:49 aggarwal
- X * Added typecasting to avoid compilers complaining.
- X *
- X * Revision 1.4 1992/06/18 21:07:22 aggarwal
- X * Cleaned up the include file stuff
- 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/09 12:14:44 aggarwal
- X * Added the 'frozen' option where the poll waits indefinitely for a user
- X * input (instead of the default PAUSE seconds).
- X *
- X * Revision 1.1 89/11/08 12:22:19 aggarwal
- X * Initial revision
- X *
- X */
- X
- X#include "netmon.h"
- X
- X#ifndef PAUSE
- X#define PAUSE 15 /* wait for 15 seconds for user input */
- X#endif
- X
- Xpoll_input ()
- X{
- X extern bool frozen ; /* Defined in netmon.h */
- X struct timeval tim_v;
- X char reply;
- X int read_mask = 1 ; /* For 'select' routine */
- X
- X tim_v.tv_sec = PAUSE; /* init poll delay */
- X tim_v.tv_usec = 0;
- X
- X if (frozen)
- X reply = select (2, (fd_set *)&read_mask, (fd_set *)0, (fd_set *)0, NULL) ;
- X else
- X reply = select (2, (fd_set *)&read_mask, (fd_set *)0,(fd_set *)0, &tim_v);
- X
- X if (!(reply && read_mask)) /* no input, timed out */
- X return(0);
- X else
- X return (getchar()) ; /* return the input */
- X}
- END_OF_FILE
- if test 1744 -ne `wc -c <'nocol-3.0/src/netmon/poll_input.c'`; then
- echo shar: \"'nocol-3.0/src/netmon/poll_input.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/netmon/poll_input.c'
- fi
- if test -f 'nocol-3.0/src/noclog/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/noclog/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/noclog/Makefile'\" \(1870 characters\)
- sed "s/^X//" >'nocol-3.0/src/noclog/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.2 1993/10/30 03:44:36 aggarwal Exp $
- X#
- X# Makefile for 'nocold'
- X#
- X#
- X# ETC is used for the config file and error log file.
- X# Also EDIT THE ../include/noclogd.h for setting host and other information.
- X
- X## SET THIS
- X# Directories needed by the Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# NLOG_HOST host where the noclogd logging daemon runs
- X#
- XNLOG_HOST = noclog.jvnc.net
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- XSYSDEFS =
- XINSTALL = install
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DNLOG_HOST=\"$(NLOG_HOST)\"
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -I../include -L$(LIBDIR) -L../lib
- X
- XTARG = noclogd
- XOBJECTS = noclogd.o
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $(TARG)
- X
- Xall: $(TARG) stress_noclogd newtest
- X
- Xstress_noclogd: stress_noclogd.o Makefile
- X $(CC) $(CFLAGS) -o stress_noclogd stress_noclogd.o $(LIBS)
- X
- Xnewtest: newtest.o Makefile
- X $(CC) $(CFLAGS) -o newtest newtest.o $(LIBS)
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/noclogd.h
- X
- Xinstall: $(TARG)
- X @[ -d $(TOP) ] || mkdir $(TOP)
- X @[ -d $(ETCDIR) ] || mkdir $(ETCDIR)
- X @[ -d $(BINDIR) ] || mkdir $(BINDIR)
- X $(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
- X @echo "___Update config file for logging daemon in $(ETCDIR) ___"
- X
- Xclean:
- X /bin/rm -f $(OBJECTS) $(TARG) *.o stress_noclogd newtest core a.out
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- X
- END_OF_FILE
- if test 1870 -ne `wc -c <'nocol-3.0/src/noclog/Makefile'`; then
- echo shar: \"'nocol-3.0/src/noclog/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/noclog/Makefile'
- fi
- if test -f 'nocol-3.0/src/nsmon/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/nsmon/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/nsmon/Makefile'\" \(1985 characters\)
- sed "s/^X//" >'nocol-3.0/src/nsmon/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.6 1993/10/02 05:39:34 aggarwal Exp aggarwal $
- X#
- X# Makefile for 'nsmon'
- X#
- X# ETC is used for dumping the HELPFILE in that directory
- X
- X## SET THIS
- X# Directories needed by the Makefile. See description in ../Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# Directories needed by the program.
- X# DATADIR for creating the NSMON-OUTPUT
- X# NODESFILE config file for list of nodes to be monitored
- X# DOMAINNAME your host's domain name (berkeley.edu) for
- X# which the nameservers tested are authoratative
- XDATADIR = $(TOP)/data
- XNODESFILE = $(ETCDIR)/nsmon-confg
- XDOMAINNAME = jvnc.net
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- XSYSDEFS =
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DDATADIR=\"$(DATADIR)\" \
- X -DNODESFILE=\"$(NODESFILE)\" \
- X -DQUERYDATA=\"$(DOMAINNAME)\"
- X
- X# Compilation definitions
- X# The 'libresolv' lib might be needed here...
- X# SYSLIBS = -lresolv
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -L$(LIBDIR) -I../include -L../lib
- X
- XTARG = nsmon
- XOBJECTS = main.o nsmon.o poll_sites.o
- X
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@
- X
- X######
- X# small testing program to demonstrate the throughput() function
- X###
- Xtest nstest: nstest.o nsmon.o
- X $(CC) $(CFLAGS) -o nstest nsmon.o nstest.o
- X
- X.c.o:
- X $(CC) -c $(CFLAGS) $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/nsmon.h
- X
- Xinstall: $(TARG)
- X $(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
- X @echo "___Update $(NODESFILE) with nameserver test information___"
- X
- Xclean:
- X /bin/rm -f $(TARG) $(OBJECTS) core a.out
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- END_OF_FILE
- if test 1985 -ne `wc -c <'nocol-3.0/src/nsmon/Makefile'`; then
- echo shar: \"'nocol-3.0/src/nsmon/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/nsmon/Makefile'
- fi
- if test -f 'nocol-3.0/src/nsmon/nsmon-confg' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/nsmon/nsmon-confg'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/nsmon/nsmon-confg'\" \(504 characters\)
- sed "s/^X//" >'nocol-3.0/src/nsmon/nsmon-confg' <<'END_OF_FILE'
- X# $Id: nsmon-confg,v 1.2 1993/10/30 03:43:33 aggarwal Exp $
- X#
- X# Config file for 'nsmon'. Set the list of servers that are to be
- X# monitored for their nameserver process over here.
- X#
- X# The query type is for SOA and the query name (domain) is hardcoded
- X# in the include file.
- X#
- X# POLLINTERVAL <secs>
- X# DOMAINNAME <string> <- over-rides compile time default
- X#
- X# hostname ipaddress
- X#
- XPOLLINTERVAL 600
- X#
- XDOMAINNAME jvnc.net
- X#
- Xnisc 128.121.50.7
- Xr2d2 128.121.50.2
- Xdumbo 128.121.50.147
- Xcolumbia 128.59.40.142
- END_OF_FILE
- if test 504 -ne `wc -c <'nocol-3.0/src/nsmon/nsmon-confg'`; then
- echo shar: \"'nocol-3.0/src/nsmon/nsmon-confg'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/nsmon/nsmon-confg'
- fi
- if test -f 'nocol-3.0/src/nsmon/nstest.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/nsmon/nstest.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/nsmon/nstest.c'\" \(1577 characters\)
- sed "s/^X//" >'nocol-3.0/src/nsmon/nstest.c' <<'END_OF_FILE'
- X/* $Header: /home/aggarwal/lsrc/nocol/src/nsmon/RCS/nstest.c,v 1.3 1993/10/30 03:43:07 aggarwal Exp $ */
- X
- X/* Copyright 1993 JvNCnet, Global Enterprise Services */
- X
- X/*+
- X * FUNCTION:
- X * Small standalone program to test nsmon().
- X *
- X * AUTHOR:
- X * S. Spencer Sun, spencer@phoenix.princeton.edu
- X */
- X
- X#include <stdio.h>
- X#include <sys/types.h>
- X#include <arpa/nameser.h>
- X#include "nsmon.h"
- X
- Xusage()
- X{
- X fprintf(stderr,
- X "Usage: nstest [ -d ] [ -C query class ] [ -T query type ]\n");
- X fprintf(stderr, "\t[ -t timeout (secs) ] nameserver [ nameserver ... ]\n");
- X exit(1);
- X}
- X
- Xmain(argc, argv)
- X int argc;
- X char *argv[];
- X{
- X int class, type, timeout, ch;
- X int aaonly = 0, debug = 0;
- X extern char *optarg;
- X extern int optind;
- X
- X class = C_IN; type = T_SOA; timeout = 15;
- X
- X while ((ch = getopt(argc, argv, "AC:dT:t:")) != EOF) {
- X switch (ch) {
- X case 'A':
- X aaonly = 1; break;
- X case 'C':
- X class = atoi(optarg); break;
- X case 'd':
- X debug++ ; break;
- X case 'T':
- X type = atoi(optarg); break;
- X case 't':
- X timeout = atoi(optarg); break;
- X default:
- X usage(); break;
- X }
- X }
- X argc -= optind;
- X if (argc < 1) {
- X fprintf(stderr, "nstest: no servers/requests were specified\n");
- X usage() ;
- X return 1;
- X }
- X for (argv += optind; argc >=2; argc -=2, argv +=2) {
- X printf("Server: %s Request: %s return code: %d\n",
- X argv[0], argv[1],
- X nsmon(argv[0], argv[1], class, type, timeout, aaonly, debug));
- X }
- X if (argc)
- X fprintf(stderr, "nsmon: last server did not have a request\n");
- X return 0;
- X}
- END_OF_FILE
- if test 1577 -ne `wc -c <'nocol-3.0/src/nsmon/nstest.c'`; then
- echo shar: \"'nocol-3.0/src/nsmon/nstest.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/nsmon/nstest.c'
- fi
- if test -f 'nocol-3.0/src/perlnocol/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/perlnocol/README'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/perlnocol/README'\" \(2121 characters\)
- sed "s/^X//" >'nocol-3.0/src/perlnocol/README' <<'END_OF_FILE'
- X## $Header$
- X##
- X## Perlnocol README
- X#
- X## A few perl routines that can be used with Nocol.
- X#
- Xarmon - appletalk route monitor (requires Cisco router & rcisco)
- Xbpmon - bootp monitor (requires bootpquery program)
- Xmkarmon - program to build armon configuration lines
- Xmodemmon - cisco terminal server modem line usage monitor
- Xnocollib.pl - perl library with nocol-oriented routines
- Xnovellmon - IPX service monitor (requires Cisco router & rcisco)
- Xrcisco - execute a Cisco command remotely (requires sockets.ph)
- X
- XThese routines require coding your router's p a s s w o r d in the perl
- Xcode which introduces a security risk (this is for 'rcisco' to log into
- Xyour cisco).
- X
- XRead the comments in the files and the code to learn how to use these.
- XI can offer only minimal help.
- X
- X -John Wobus
- X 9/21/93
- X
- XADDITIONAL NOTES:
- X----------------
- X
- XUsing the samples (mainly armon/modemmon/novellmon) you can build
- Xnew monitors in Perl fairly easily. Your monitor just needs to call
- Xthe 'nocollib.pl' module which has NOCOL utility routines.
- X
- X
- XINSTALLATION
- X------------
- X
- XEdit 'nocollib.pl' and set the '$nocolroot' and '$NLOG_HOST' variables
- Xat the top of the file.
- X
- XIf you want to use the supplied monitors, edit them also and insert
- Xthe location of the various required files (like rcisco) at the top
- Xof the files. Then copy these into the nocol hierarchy (nocol/bin) andcreate
- Xthe config files in nocol/etc and start them up.
- X
- X armon: This monitors AppleTalk routes from a cisco router.
- X Can be changed to use CAP's atlook instead (see notes
- X in the top of the file).
- X
- X bgpmon: Checks cisco routers to see if the various BGP peers
- X are in a connected state.
- X
- X bpmon: Checks bootp daemon on various systems.
- X
- X nrmon: Monitors Novell routes from a cisco router (similar to
- X armon).
- X
- X novellmon: Monitors Novell *services* from a cisco router.
- X
- X modemmon: Checks number of modem lines used on a cisco terminal server
- X by doing a 'who' and counting number of users on tty
- X lines.
- X
- X snmp-modemmon: An SNMP version of modemmon. Requires CMU-snmp code
- X (distributed with the NOCOL code).
- X
- X
- X
- X -Vikas Aggarwal
- X vikas@jvnc.net
- X
- END_OF_FILE
- if test 2121 -ne `wc -c <'nocol-3.0/src/perlnocol/README'`; then
- echo shar: \"'nocol-3.0/src/perlnocol/README'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/perlnocol/README'
- fi
- if test -f 'nocol-3.0/src/portmon/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/portmon/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/portmon/Makefile'\" \(1713 characters\)
- sed "s/^X//" >'nocol-3.0/src/portmon/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.1 1993/10/30 03:37:06 aggarwal Exp $
- X#
- X# Makefile for 'portmon'
- X#
- X#
- X# ETC is used for the config file and error log file.
- X# DATA is used for the data directory
- X
- X## SET THIS
- X# Directories needed by the Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# Directories needed by the program.
- X# DATADIR for creating the data OUTPUT file
- X# CONFIGFILE location of the config file
- XDATADIR = $(TOP)/data
- XCONFIGFILE = $(ETCDIR)/portmon-confg
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- XSYSDEFS =
- XINSTALL = install
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DDATADIR=\"$(DATADIR)\" \
- X -DCONFIGFILE=\"$(CONFIGFILE)\"
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -I../include -L$(LIBDIR) -L../lib
- X
- XTARG = portmon
- XOBJECTS = portmon.o
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $(TARG)
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/noclogd.h
- X
- Xinstall: $(TARG)
- X @[ -d $(TOP) ] || mkdir $(TOP)
- X @[ -d $(ETCDIR) ] || mkdir $(ETCDIR)
- X @[ -d $(BINDIR) ] || mkdir $(BINDIR)
- X $(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
- X @echo "___Update config file for $(TARG) daemon in $(ETCDIR) ___"
- X
- Xclean:
- X /bin/rm -f $(TARG) *.o core a.out
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- X
- END_OF_FILE
- if test 1713 -ne `wc -c <'nocol-3.0/src/portmon/Makefile'`; then
- echo shar: \"'nocol-3.0/src/portmon/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/portmon/Makefile'
- fi
- if test -f 'nocol-3.0/src/support/mping/msummary.dat' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/support/mping/msummary.dat'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/support/mping/msummary.dat'\" \(2411 characters\)
- sed "s/^X//" >'nocol-3.0/src/support/mping/msummary.dat' <<'END_OF_FILE'
- X#
- X# Format:
- X#
- X# name address [options]
- X#
- X# If given, <options> is one or more comma-separated fields in the order:
- X#
- X# size,pattern,numToGet,retry,timeout
- X#
- X# This parses option fields left to right, as indicated by commas. Missing
- X# or empty fields use the default value (see below). For example, the
- X# option string to specify just the size (128) and pattern (0x15) would be
- X# "128,0x15": the remaining fields would default. To specify a size (128)
- X# and a retry count (2), the option field would be "128,,,2". To specify
- X# just a timeout of 2 seconds, the option string would be ",,,,2000".
- X#
- X#
- X# size [default: 56]: Decimal number giving the size of the ICMP
- X# data portion of the packet. The actual IP
- X# packet will be at least 8 octets larger.
- X#
- X# pattern [default: 0x0]: A hex number specifying a byte value to
- X# initialize the ICMP data portion of the
- X# packet.
- X#
- X# numToGet [default: 1]: Number of return packets to require.
- X#
- X# retry [default: 5]: Number of retries to make before declaring
- X# a packet lost. Note that if <numToGet> is
- X# greater than 1, the retry limit applies to
- X# each attempt. That is if the first attempt
- X# requires 4 tries before a successful return,
- X# then next attempt will still make up to 5
- X# tries.
- X#
- X# timeout [default: 1000] Number of milliseconds to wait before
- X# assuming packet lost and retrying. The
- X# default timeout is fine within an all
- X# ethernet environment, but you need a longer
- X# one for WAN links.
- X#
- X# The <name> field is not used for anything except producing the report.
- X#
- X# The <address> field can be either an IP address in any of the notations
- X# acceptable to the inet_addr() function, or it can be a domain name.
- X# If a domain name is used, and the gethostbyname() function returns
- X# more than one address, it is treated like multiple configuration lines,
- X# one for each address. For example the configuration line:
- X#
- X# NS-NIC ns.nic.ddn.mil 56,0,2
- X#
- X# is treated as if read:
- X#
- X# NS-NIC 192.112.36.4 56,0,2
- X# NS-NIC 192.67.67.53 56,0,2
- X#
- X#
- X
- X
- X# Just for samples
- Xenvy.net-ether0 130.132.1.19 128,0,2
- Xenvy.net-ether1 130.132.19.1 128,0,2
- Xenvy.net-ether2 128.36.0.2 128,0,2
- Xenvy.net-ether3 130.132.32.1 128,0,2
- Xenvy.net-ether4 130.132.80.1 128,0,2
- X
- X# Now monitor the JvNCnet NSS, use pattern 0xAA
- X# (binary 10101010) and be a bit more patient than the default
- Xnss.jvnc.net 192.12.211.1 256,0xaa,2,5,2000
- END_OF_FILE
- if test 2411 -ne `wc -c <'nocol-3.0/src/support/mping/msummary.dat'`; then
- echo shar: \"'nocol-3.0/src/support/mping/msummary.dat'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/support/mping/msummary.dat'
- fi
- if test -f 'nocol-3.0/src/support/multiping/pingmisc.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/support/multiping/pingmisc.c'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/support/multiping/pingmisc.c'\" \(2026 characters\)
- sed "s/^X//" >'nocol-3.0/src/support/multiping/pingmisc.c' <<'END_OF_FILE'
- X/*
- X * pingmisc.c -- auxiliary routines for multiping.c
- X */
- X
- X#include <sys/param.h>
- X#include <sys/types.h>
- X#include <sys/socket.h>
- X#include <netinet/in.h>
- X#include <values.h>
- X#include <stdio.h>
- X#include <stdlib.h>
- X#include <netdb.h>
- X
- X#undef GLOBALS
- X#include "multiping.h"
- X#include "vars.h"
- X
- X/*
- X * Initialize some stuff
- X */
- Xstartup()
- X{
- X int i;
- X
- X numsites = 0;
- X for (i = 0; i < MAXREMOTE; i++)
- X dest[i] = NULL;
- X datalen = DEFDATALEN;
- X}
- X
- X/*
- X * allocates a destrec and initializes its fields
- X */
- Xdestrec *dest_malloc()
- X{
- X destrec *p;
- X int i;
- X
- X p = (destrec *)malloc(sizeof(destrec));
- X if ((p == NULL) || ((p->rcvd_tbl = malloc(MAX_DUP_CHK / 8)) == NULL)) {
- X fprintf(stderr, "ping: dest_malloc: out of memory\n");
- X exit(1);
- X }
- X for (i = 0; i < MAX_DUP_CHK / 8; i++)
- X p->rcvd_tbl[i] = 0;
- X p->nreceived = p->nrepeats = p->ntransmitted = (char)0;
- X p->hostname[0] = '\0';
- X p->tmax = p->tsum = 0;
- X p->tmin = MAXSHORT;
- X return p;
- X}
- X
- X/*
- X * Takes a host name like 'phoenix.princeton.edu' or an IP address
- X * like '128.112.120.1' and creates an entry for that host in the
- X * dest[] array.
- X */
- Xsetup_sockaddr(addr)
- X char *addr;
- X{
- X destrec *dst;
- X struct sockaddr_in *to;
- X struct hostent *hp;
- X
- X dst = dest_malloc();
- X bzero((char*)&(dst->sockad), sizeof(struct sockaddr_in));
- X to = &dst->sockad;
- X to->sin_family = PF_INET;
- X to->sin_addr.s_addr = inet_addr(addr);
- X if (to->sin_addr.s_addr != (u_int)-1)
- X strcpy(dst->hostname, addr);
- X else {
- X hp = gethostbyname(addr);
- X if (hp == NULL) {
- X fprintf(stderr, "ping: unknown host %s\n", addr);
- X exit(1);
- X }
- X to->sin_family = hp->h_addrtype;
- X bcopy(hp->h_addr, (caddr_t)&to->sin_addr, hp->h_length);
- X strncpy(dst->hostname, hp->h_name, MAXHOSTNAMELEN-1);
- X }
- X dest[numsites++] = dst;
- X if (to->sin_family == PF_INET)
- X printf("PING %s (%s): %d data bytes\n", pr_addr(to->sin_addr.s_addr),
- X inet_ntoa(*(struct in_addr *)&to->sin_addr.s_addr), datalen);
- X else
- X printf("PING %s: %d data bytes", dst->hostname, datalen);
- X}
- END_OF_FILE
- if test 2026 -ne `wc -c <'nocol-3.0/src/support/multiping/pingmisc.c'`; then
- echo shar: \"'nocol-3.0/src/support/multiping/pingmisc.c'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/support/multiping/pingmisc.c'
- fi
- if test -f 'nocol-3.0/src/tpmon/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/tpmon/Makefile'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/tpmon/Makefile'\" \(1691 characters\)
- sed "s/^X//" >'nocol-3.0/src/tpmon/Makefile' <<'END_OF_FILE'
- X# $Id: Makefile,v 1.5 1993/10/30 03:27:06 aggarwal Exp $
- X#
- X# Makefile for 'tpmon' (thruput monitor)
- X#
- X
- X## SET THIS
- X# Directories needed by the Makefile. See description in ../Makefile
- XTOP = /usr/nocol
- XSRCDIR = $(TOP)/src
- X
- XBINDIR = $(TOP)/bin
- XETCDIR = $(TOP)/etc
- XINCLUDEDIR = $(SRCDIR)/include
- XLIBDIR = $(SRCDIR)/lib
- X
- X## SET THIS
- X# Directories needed by the program.
- X# DATADIR for creating the TPMON-OUTPUT
- X# NODESFILE config file for list of nodes to be monitored
- XDATADIR = $(TOP)/data
- XNODESFILE = $(ETCDIR)/tpmon-confg
- X
- X## SET THIS
- X# Set the various defines for compile time defines:
- X#
- X#
- XSYSDEFS =
- XINSTALL = install
- X
- X####
- X#### Can leave the rest alone #######
- X####
- X
- X##
- X# The various directories that are needed in the program. Should NOT
- X# have trailing '/'.
- XDIRDEFS = -DETCDIR=\"$(ETCDIR)\" \
- X -DDATADIR=\"$(DATADIR)\" \
- X -DNODESFILE=\"$(NODESFILE)\"
- X
- X# Compilation definitions
- XCC = cc
- XCDEFS = $(DIRDEFS) $(SYSDEFS)
- XLIBS = -lnocol $(SYSLIBS)
- XCFLAGS = -g -I$(INCLUDEDIR) -L$(LIBDIR)
- X
- XTARG = tpmon
- XOBJECTS = main.o poll_sites.o tpmon.o
- X
- X
- X$(TARG): $(OBJECTS) Makefile
- X $(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@
- X
- X######
- X# small testing program to demonstrate the throughput() function
- X###
- Xtest tptest: tptest.o tpmon.o tptest.h
- X $(CC) $(CFLAGS) -o tptest tpmon.o tptest.o
- X
- X.c.o:
- X $(CC) -c $(CFLAGS) $(CDEFS) $<
- X
- X## The dependencies in case 'mkdep' not used
- X#
- X$(OBJECTS): $(INCLUDEDIR)/nocol.h $(INCLUDEDIR)/tpmon.h
- X
- Xinstall: $(TARG)
- X $(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
- X @echo "___Update config file in $(ETCDIR)___"
- X
- Xclean:
- X /bin/rm -f $(TARG) *.o core a.out tptest
- X
- Xrcs:
- X @echo "Doing 'rcs' in $(TARG)"
- X @-for i in $(OBJS); do \
- X $(CO) -q `basename $$i .o`.c ;\
- X done
- END_OF_FILE
- if test 1691 -ne `wc -c <'nocol-3.0/src/tpmon/Makefile'`; then
- echo shar: \"'nocol-3.0/src/tpmon/Makefile'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/tpmon/Makefile'
- fi
- if test -f 'nocol-3.0/src/tpmon/tptest.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/tpmon/tptest.h'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/tpmon/tptest.h'\" \(1700 characters\)
- sed "s/^X//" >'nocol-3.0/src/tpmon/tptest.h' <<'END_OF_FILE'
- X/*
- X * $Header: /nocol/src/tpmon/RCS/tptest.h,v 1.1 1992/06/12 21:01:19 aggarwal Exp $
- X */
- X
- X/*
- X * tptest.h -- #include this file to interface with tpmon.c
- X *
- X * This header file is NOT part of the tpmon/netmon package. It is
- X * simply an interface file that you can #include to use the
- X * throughput() routine, should you wish to use it in any of your
- X * own programs.
- X *
- X * See tptest.c and 'make tptest' for an example.
- X *
- X * === NOTE === tpmon.c expects an extern char *prognm which points to
- X * the program's name, so that it can stick this in error messages
- X */
- X
- X#ifndef __TP_H__
- X#define __TP_H__
- X
- X/* these variables are exported in case you're interested in them */
- 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, int numblocks, int blocksize,
- X char *pattern, int time, int verbose */);
- X
- X#endif
- END_OF_FILE
- if test 1700 -ne `wc -c <'nocol-3.0/src/tpmon/tptest.h'`; then
- echo shar: \"'nocol-3.0/src/tpmon/tptest.h'\" unpacked with wrong size!
- fi
- # end of 'nocol-3.0/src/tpmon/tptest.h'
- fi
- if test -f 'nocol-3.0/src/utility/keepalive_monitors' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'nocol-3.0/src/utility/keepalive_monitors'\"
- else
- echo shar: Extracting \"'nocol-3.0/src/utility/keepalive_monitors'\" \(1702 characters\)
- sed "s/^X//" >'nocol-3.0/src/utility/keepalive_monitors' <<'END_OF_FILE'
- X#!/bin/csh -f
- X#
- X# $Header: /home/aggarwal/lsrc/nocol/src/utility/RCS/keepalive_monitors,v 1.7 1993/10/30 03:32:24 aggarwal Exp $
- X#
- X# Make sure that the various nocol programs are doing their job and are
- X# not dead.
- X#
- X# Can run this from the crontab every so often/
- X#
- X# For special montitors that require command line arguments, treat them
- X# specially in the 'if' statement (see 'trapmon')
- X#
- X# Vikas, Nov 30, 1989
- X# Vikas, Oct 1, 1993
- X#
- Xumask 002
- X
- Xset BIN = /nocol/bin
- Xset ETC = /nocol/etc
- Xset OPS = noc@nisc.jvnc.net # mail on restarting
- Xset MAIL = /usr/ucb/mail
- Xset PROGRAMS = "" # initially null
- Xset path = (${BIN} /bin /etc /usr/bin /usr/ucb /usr/lib)
- Xset HOST = `hostname`
- X
- X##
- X# Which program should run on which host.
- Xif ( ${HOST} == "minnie.jvnc.net" ) then
- X set PROGRAMS = "noclogd ippingmon nsmon tpmon"
- Xelse if ( ${HOST} == "mickey.jvnc.net" ) then
- X set PROGRAMS = "trapmon"
- Xelse
- X exit 0
- Xendif
- X
- Xcd $BIN
- X
- X## Account for the programs that have a pid file, and those that don't.
- X# See which monitors are running.
- Xforeach p ( ${PROGRAMS} )
- X set START = "0" #initial value
- X
- X if ( -e ${ETC}/${p}.pid ) then
- X set pid = `head -1 ${ETC}/${p}.pid`
- X if ( `ps ${pid} | grep ${p} | wc -l` == 0 && -x $p ) set START = "1"
- X else
- X set lc = `ps -ax |egrep "${BIN}/${p}" |grep -v grep`
- X if ( "$lc" == "" && -x $p ) set START = "1"
- X endif
- X
- X ## Now start the monitors
- X if ( ${START} == "1" ) then
- X if ( $?prompt ) echo "Starting $p at `date` on `hostname`"
- X if ( ${p} == "trapmon" ) then
- X ( ${BIN}/trapmon -n ) >>&! ${ETC}/${p}.error &
- X else
- X ( ${BIN}/${p} ) >>&! ${ETC}/${p}.error &
- X endif
- X echo " -keepalive" |${MAIL} -s "NOCOL Restarted ${p} on ${HOST}" $OPS
- X endif
- X
- Xend # of foreach()
- X
- X####
- END_OF_FILE
- if test 1702 -ne `wc -c <'nocol-3.0/src/utility/keepalive_monitors'`; then
- echo shar: \"'nocol-3.0/src/utility/keepalive_monitors'\" unpacked with wrong size!
- fi
- chmod +x 'nocol-3.0/src/utility/keepalive_monitors'
- # end of 'nocol-3.0/src/utility/keepalive_monitors'
- fi
- echo shar: End of archive 25 \(of 26\).
- cp /dev/null ark25isdone
- 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...
-