01-30-2009 11:47 AM
Anyone have a scripted keepalive handy to help with having a CSS 11503 monitor an ASPX page and then notify a server administrator if the page becomes unavailable? Here's my sample service config:
<br />
<br />service aspx-server
<br /> ip addr 1.1.1.1
<br /> keepalive type http
<br /> keepalive uri â/serverpage.aspxâ
<br /> keepalive method head (default)
<br /> active
<br />
<br />I've previously used the global command âlogging sendmail (recipient ip addr) (mail server ip addr) (level of notification to receive)â, but I'd like to have this notification be more surgical in its delivery to a user/group mailbox, not a destination ip address.
<br />
03-16-2009 11:03 AM
I have done this - although recently it has started to misbehave slightly. In sniffing, it looks like OCCASIONALLY the CSS "forgets" to send the request, and then sends directed E-mail messages indicating a service is down because it didn't see the reply (which it isn't...).
service val-srv1
ip address 192.168.1.99
keepalive frequency 255
keepalive retryperiod 255
keepalive type script valsrv1-kal "valsrv1 http://valsrv1/test/healthcheck.asp"
active
====================
Filename : valsrv1-kal
Paramters : HOSTNAME PAGE2CALL
if ${ARGS}[#] "NEQ" "2"
echo "Check parameters\n"
exit script 1
endbranch
set HOSTNAME "${ARGS}[1]"
set PAGE2CALL "GET ${ARGS}[2]\n"
set CONTINUE_ON_ERROR "1"
socket connect host ${HOSTNAME} port 80 tcp 5000
socket send ${SOCKET} "${PAGE2CALL}"
!socket receive ${SOCKET}
!socket inspect ${SOCKET}
socket waitfor ${SOCKET} "Sanity check returns 200" 5000
if ${STATUS} "NEQ" "0"
socket disconnect ${SOCKET}
socket connect host
socket send ${SOCKET} "HELO
socket waitfor ${SOCKET} "250" 300
socket send ${SOCKET} "MAIL FROM: Whoever\n"
socket waitfor ${SOCKET} "250" 300
socket send ${SOCKET} "RCPT TO: bugs@disney.com\n"
socket waitfor ${SOCKET} "250" 300
socket send ${SOCKET} "RCPT TO: eFudd@disney.com\n"
socket waitfor ${SOCKET} "250" 300
socket send ${SOCKET} "DATA \n"
socket waitfor ${SOCKET} "354" 300
socket send ${SOCKET} "To : Bugs@disney.com\n"
socket send ${SOCKET} "cc : eFudd\n"
socket send ${SOCKET} "Subject : Error - Server failure \n"
socket send ${SOCKET} "Server ${HOSTNAME} failed health check\n"
socket send ${SOCKET} "v1.1\n"
socket send ${SOCKET} ".\n"
socket waitfor ${SOCKET} "250" 1000
socket send ${SOCKET} "QUIT\n"
socket disconnect ${SOCKET}
exit script 1
endbranch
socket disconnect ${SOCKET}
exit script 0
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide