Re: Script question (payment for correct answer)
- From: edcrosbys <edcrosbys@xxxxxxxxx>
- Date: Fri, 10 Oct 2008 09:46:50 -0700 (PDT)
On Oct 10, 11:20 am, unix <unix...@xxxxxxxxx> wrote:
My apology if this is unethical for this NG. I figure, I'm getting
$100 to set this up for a client, so I'll happily transfer $50 via
Paypal to anyone that can do this script. (I just don't have time now
to figure it out).
It's actually fairly simple (for you gurus):
Request details:
1. check (via netstat) for connections to port 5111 to see that there
is at least one session that is ESTABLISHED on that port.
2. if there are NO sessions with that status, send a warning message
(via plain mailx) to 3 defined receipients.
3. This daemon has to send alerts only between 2:AM EST - 5:PM EST Mon-
Fri. (i.e. we don't care if there are no sessions at other times).
Thanks in advance,
Roger
(If you don't have Paypal, I can send check as well)
Here's something quick and dirty(works in solaris 10, what OS are you
using):
#!/usr/bin/ksh
rcpts=some1@xxxxxxxxxxxxx, some2@xxxxxxxxxxxxx, some3@xxxxxxxxxxxxx
netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
s "The Very Important Connection isn't there" ${rcpts} < /dev/null
.
- Follow-Ups:
- References:
- Script question (payment for correct answer)
- From: unix
- Script question (payment for correct answer)
- Prev by Date: jumpstart over firewalled networks
- Next by Date: SMF method failed
- Previous by thread: Script question (payment for correct answer)
- Next by thread: Re: Script question (payment for correct answer)
- Index(es):
Relevant Pages
|