[mrtg] Re: Thresh question

Martin Rheumer martinr at hotkey.net.au
Sun Dec 2 21:35:39 MET 2001


Raymond, we do this because mrtg was already running perfectly
and didnt want to add another product.
Here is a snippet of some shocking perl code I wrote to do such
a thing.

$rac_name = $ARGV[0];

if (!(open TMP, "< /tmp/$rac_name"))
{
    $count = 0;
    open (TMP, ">/tmp/$rac_name");
    print TMP "1";
    exit 5;
}
open (TMP, "</tmp/$rac_name");
while (<TMP>)
{
    $count = $_;
}

if ($count == 12)
{
    unlink ("/tmp/$rac_name");
}
else
{
    open (TMP, ">/tmp/$rac_name");
    $count +=1;
    print TMP "$count";
    exit 5
}

It will count 12 times for a threshold infringement before it sends
an email. Its called as the ThreshProg for modem racks that have no
calls on them ( generally PRA problems ).
If its failed for 12 counts ( approx 60 minutes it sends an email ).

Hope this is helpful

Martin



At 09:37 AM 11/30/01 -0500, Daniel R . Kilbourne wrote:
>
>Don't use mrtg for this, it is not the right tool.
>
>There are several tools out there for system notifications, what OS are
you running?
>
>
>If you are running *nix, I would recommend sysmon (http://www.sysmon.org)
- great tool, and easy to ruun
>
>
>Raymond Norton extolled:
>> 
>> I am using ThreshMinO[x.x.x.x]: 0  on  ver 2.9.17 to fire off an email when
>> my server goes down. This particular server is located at a wireless
ISP. It
>> looks like they loose signal briefly many times in the day, hence I get
>> about 20+ email warnings from mrtg. I am limited in my understanding,
but is
>> there a way to tell mrtg to wait until it misses 3-4 polls before sending
>> the network down message?
>
>-- 
>--------------------------------
>    Daniel R. Kilbourne
>    drk at netophilia.net
>________________________________
>
>--
>Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
>Archive     http://www.ee.ethz.ch/~slist/mrtg
>FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
>WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>
>

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list