I used to have a job that re-streamed itself every 30 minutes, checking
connectivity from our production 3000 to our various field sites. If there
was a problem, we got emailed (via the sendhtml.xeq.threek command file -
which comes with NetMail/3000). It used the following command file to do the
checks. HTH.
-Chris Bartram
:PRINT PINGSTAT.XEQ
parm ipaddr,n=20,b=1200,mailit="N",lim=0,nodename="",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 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 (!nodename) !hpdatef !hptimef > PNGM
echo Problem pinging a host from !HPSYSNAME >> PNGM
echo See subject line >> PNGM
IF !_pingloss=999 THEN
continue
xeq sendhtml.xeq.threek ^netguys.data.sys,batch,,PNGM,&
'Problem pinging (!nodename) !_pingnode'
ELSE
IF !_pingloss>=!emerglim THEN
continue
xeq sendhtml.xeq.threek ^netguys2.data.sys,batch,,PNGM,&
'Urgent:(!nodename)!_pingloss% packet loss to !_pingnode'
ELSE
IF !_pingloss>!lim THEN
continue
xeq sendhtml.xeq.threek ^netguys.data.sys,batch,,PNGM,&
'(!nodename)!_pingloss% packet loss to !_pingnode'
ENDIF
ENDIF
ENDIF
continue
purge pngm,temp > $NULL
ENDIF
Robert Mills <mailto:[log in to unmask]> wrote:
> I want to get our primary box to check, on a regular basis, if the
> secondary box is still alive and working.
>
> The primary box has MPEX (was thinking of using a %BACKG task to do
> this). Both boxes are running 6.5 and are connected via NS.
>
> Any suggestions on the least intrusive method?
>
> regards,
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|