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)
|
|
0
|
|
|
|
Reply
|
unixzip (36)
|
10/10/2008 3:20:21 PM |
|
On Oct 10, 11:20=A0am, unix <unix...@yahoo.com> 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=3Dsome1@important.com, some2@important.com, some3@important.com
netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
s "The Very Important Connection isn't there" ${rcpts} < /dev/null
|
|
0
|
|
|
|
Reply
|
edcrosbys
|
10/10/2008 4:46:50 PM
|
|
On Oct 10, 12:46=A0pm, edcrosbys <edcros...@gmail.com> wrote:
> On Oct 10, 11:20=A0am, unix <unix...@yahoo.com> 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=3Dso...@important.com, so...@important.com, so...@important.com
> netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
> s "The Very Important Connection isn't there" ${rcpts} < /dev/null- Hide =
quoted text -
>
> - Show quoted text -
This is on a 9 server
|
|
0
|
|
|
|
Reply
|
mark
|
10/10/2008 5:58:51 PM
|
|
On Oct 10, 12:46=A0pm, edcrosbys <edcros...@gmail.com> wrote:
> On Oct 10, 11:20=A0am, unix <unix...@yahoo.com> 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=3Dso...@important.com, so...@important.com, so...@important.com
> netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
> s "The Very Important Connection isn't there" ${rcpts} < /dev/null- Hide =
quoted text -
>
> - Show quoted text -
What about time frames ? (2AM - 5PM)
|
|
0
|
|
|
|
Reply
|
mark
|
10/10/2008 6:01:31 PM
|
|
mark wrote:
> On Oct 10, 12:46 pm, edcrosbys <edcros...@gmail.com> wrote:
>> On Oct 10, 11:20 am, unix <unix...@yahoo.com> wrote:
>>> 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).
>> Here's something quick and dirty(works in solaris 10, what OS are you
>> using):
>>
>> #!/usr/bin/ksh
>>
>> rcpts=so...@important.com, so...@important.com, so...@important.com
>> netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
>> s "The Very Important Connection isn't there" ${rcpts} < /dev/null- Hide quoted text -
>>
>> - Show quoted text -
>
> What about time frames ? (2AM - 5PM)
crontab -e someuser
* 2-17 * * 1-5 /path/to/script > /dev/null 2>&1
|
|
0
|
|
|
|
Reply
|
Oscar
|
10/10/2008 6:38:48 PM
|
|
Oscar del Rio wrote:
> mark wrote:
>> On Oct 10, 12:46 pm, edcrosbys <edcros...@gmail.com> wrote:
>>> On Oct 10, 11:20 am, unix <unix...@yahoo.com> wrote:
>>>> 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).
>
>>> Here's something quick and dirty(works in solaris 10, what OS are you
>>> using):
>>>
>>> #!/usr/bin/ksh
>>>
>>> rcpts=so...@important.com, so...@important.com, so...@important.com
>>> netstat -anf inet |grep ESTABLISH |grep ".5111" > /dev/null || mailx -
>>> s "The Very Important Connection isn't there" ${rcpts} < /dev/null-
>>> Hide quoted text -
>>>
>>> - Show quoted text -
>>
>> What about time frames ? (2AM - 5PM)
>
> crontab -e someuser
>
> * 2-17 * * 1-5 /path/to/script > /dev/null 2>&1
of course, if the service is not running the ops will get the email every
minute! if they can stand it say every 10 minutes, then use
0,10,20,30,40,50 2-17 * * 1-5 /path/to/script > /dev/null 2>&1
|
|
0
|
|
|
|
Reply
|
Oscar
|
10/10/2008 6:42:20 PM
|
|
Yeah, I'm a 5 minutes kinda monitoring guy (for stuff I consider
important). I've seen a badly written script that runs every minute
and a hung NFS mount cause all the other jobs for cron to hang. This
wasn't caught because the syslog monitor was kicked off via cron. If
we had the script running ever 5 minutes instead of every minute, the
condition would have taken longer to happen and we would have probably
noticed it by then.
We've since changed the way we do stuff regarding log monitoring. The
script stays running and the cron job just makes sure an instance is
running, and goes away quietly.
|
|
0
|
|
|
|
Reply
|
edcrosbys
|
10/10/2008 7:02:12 PM
|
|
|
6 Replies
105 Views
(page loaded in 0.072 seconds)
|