HP3000-L Archives

October 1999, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chris Bartram <[log in to unmask]>
Reply To:
Date:
Thu, 14 Oct 1999 11:09:28 -0400
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (129 lines)
 In <s805855a.028@ATRIUM04> [log in to unmask] writes:

> > I immediatly found the ping command, but every time I executed ping it > jus
> st
> returned to the command prompt without doing anything.   No message, > or
> security violation. I had to log on as manager .sys before it would > work.
> >
> > Does ping requiere a special capability.

Yes; I believe it wants NA or NM.

And while we're all throwing in our favorite PING command files ad nauseum,
here's one I did recently that we use in a batch job to check the status of
various routers on our network. It pings and records the packet loss %, then
emails a notice to one of two lists based on the loss-percentage. If nothing
else, it sets CIVars to the ping stats so they can be checked in JCL.

Enjoy,
   Chris Bartram

----------------------------cut here--------------------------
parm ipaddr,n=20,b=1200,mailit="N",lim=0,sitename="",emerglim=100
#
# This command file pings a machine 'ipaddr' 'n' times with a packet
# 'b' bytes long. It records stats into a temp message file, then
# reads the stats back and looks for packet loss
# 'lim' is the max acceptable packet loss before an error is mailed
#
# If 'mailit'="Y" then we'll email a report to the netguys.data.sys
# distribution list.
# And if the packet loss is >=emerglim we'll email netguys2.data.sys
# (the emergency/urgent list)
#
continue
purge pingf > $NULL
build pingf;rec=-80,,f,ascii;msg
file pngf=pingf,old;acc=append
xeq ping.net.sys "!ipaddr,!n,!b" > *pngf

while finfo("pingf","EOF")>2 do

#
# eat records til the last two records
#

  input _frec < pingf
endwhile

setvar _pingnode "!ipaddr"
setvar _pingloss 999
setvar _pingmax 0
setvar _pingavg 0

if finfo("pingf","eof")=2 then
  input _frec < pingf
  input _stats < pingf

  if word("!_stats",,-1)="loss" then
    setvar _pingloss word("!_stats",,-4)
    setvar _pingmax 0
    setvar _pingavg 0
   else
    setvar _pingloss word("!_frec",,-4)
    setvar _pingmax word("!_stats","/ ",-1)
    setvar _pingavg word("!_stats","/ ",-2)
  endif

#
# the last two lines of the file will (normally) look like:
#
# 20 packet(s) transmitted, 20 packet(s) received, 0 % packet loss
# round trip (ms)  min/avg/max = 4 / 5 / 12
#
  deletevar _stats
endif

deletevar _frec
purge pingf > $NULL

showvar _ping@

IF UPS("!mailit")="Y" THEN

  echo Problem pinging a host from the HP3000                 > PNGM
  echo !hpdatef !hptimef                                      >> PNGM
  echo See subject line                                       >> PNGM

  IF !_pingloss=999 THEN

      continue
      xeq sendhtml.xeq.sys ^netguys.data.sys,batch,,PNGM,&
        'Problem pinging !_pingnode !sitename'

  ELSE
    IF !_pingloss>=!emerglim THEN

      continue
      xeq sendhtml.xeq.sys ^netguys2.data.sys,batch,,PNGM,&
        'Urgent: Packet loss !_pingloss% to !_pingnode !sitename'

     ELSE

      IF !_pingloss>!lim THEN

        continue
        xeq sendhtml.xeq.sys ^netguys.data.sys,batch,,PNGM,&
          'Packet loss of !_pingloss% to !_pingnode !sitename'

      ENDIF
    ENDIF
  ENDIF
  continue
  purge pngm,temp > $NULL

ENDIF
----------------------------cut here--------------------------


______________________/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_
  Chris Bartram        Sales (US):   800 Net-Mail    Fax:+1 503 361-8895
   ______                         +1 503 361-8850    mailto:sales at 3k.com
  /__ |  \__________   Sales (Europe):+44(1480)414131 Fax:+44(1480)414134
 /  / | / ________     Sales (Pacific):+61 3 9488 4333 Fax:+61 3 9482 5124
|  /_ |<  ______       Tech Support:+1 503 361-8833
 \ __)| \ ___          mailto:support at 3k.com       Me: rcb at 3k.com
  \______/Associates,  PO Box 6003, Springfield VA 22150
_________________Inc._/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_/\_
Gopher: gopher.3k.com   Anon-FTP: ftp.3k.com  WWW: http://www.3k.com/

ATOM RSS1 RSS2