Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  11 Aug 2003, Konstantin Olchanski, , Alarm on no ping? 
    Reply  18 Dec 2003, Stefan Ritt, , Alarm on no ping? 
Message ID: 4     Entry time: 18 Dec 2003     In reply to: 2
Author: Stefan Ritt 
Subject: Alarm on no ping? 
> I want midas alarms to go off when I cannot ping arbitrary remote hosts. Is
> there is easy/preferred way to do this? K.O.

There are "internal alarms" with type AT_EVALUATED. Just find a program 
where you can put some code which gets periodically executed (like the idle 
loop in the frontend), and so something like:

DWORD last = 0;

  if (ss_time() > last+60)
    last = ss_time();

    /* do a ping via socket(), bind() and connect() */

    if (status != CM_SUCCESS)
      al_trigger_alarm("XYZ Ping", str, "Warning", 
                       "Host is dead", AT_INTERNAL);

Pierre does the same thing in lazylogger.c, just have a look. I don't know 
how to do a ping correctly in C, I guess you have to send an UDP packet 
somewhere, but I never did it. If you find it out, please post it.

ELOG V3.1.4-2e1708b5