/[monit]/monit/p.y
ViewVC logotype

Diff of /monit/p.y

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.133 by martinp, Thu Sep 25 15:22:10 2003 UTC revision 1.134 by hauk, Fri Sep 26 01:04:43 2003 UTC
# Line 1141  static void postparse() { Line 1141  static void postparse() {
1141      cfg_errflag++;      cfg_errflag++;
1142    }    }
1143    
1144    /* Verify that a remote service has a port list */    /* Verify that a remote service has a port or an icmp list */
1145    for(s= servicelist; s; s= s->next) {    for(s= servicelist; s; s= s->next) {
1146      if(s->type != TYPE_REMOTE)      if(s->type != TYPE_REMOTE)
1147          continue;          continue;
1148      if(!s->portlist) {      if(!s->portlist && !s->icmplist) {
1149        log("%s: 'check host' statement error; Please specify a port number"        log("%s: 'check host' statement error; Please specify a port number"
1150            " to test at\n the remote host: '%s'\n", prog, s->name);            " to test\n or an icmp test at the remote host: '%s'\n",
1151              prog, s->name);
1152        cfg_errflag++;        cfg_errflag++;
1153      }      }
1154    }    }
# Line 1600  static void adddevice(struct DeviceSet * Line 1601  static void adddevice(struct DeviceSet *
1601   */   */
1602  static void addicmp(struct IcmpSet *is) {  static void addicmp(struct IcmpSet *is) {
1603    
1604    Icmp_T icmp;    if(!getuid()) {
1605        
1606    ASSERT(is);      Icmp_T icmp;
1607          
1608    NEW(icmp);      ASSERT(is);
1609    icmp->type= is->type;      
1610    icmp->timeout= is->timeout;      NEW(icmp);
1611    icmp->action= is->action;      icmp->type= is->type;
1612        icmp->timeout= is->timeout;
1613    if((icmp->action == ACTION_EXEC) && command) {      icmp->action= is->action;
1614      icmp->exec= command;      
1615      command= NULL;      if((icmp->action == ACTION_EXEC) && command) {
1616          icmp->exec= command;
1617          command= NULL;
1618        }
1619        
1620        icmp->next= current->icmplist;
1621        current->icmplist= icmp;
1622        
1623      } else {
1624        
1625        log("%s: Ignoring icmp statement at line %d, not running as root.\n",
1626            prog, lineno-1);
1627        
1628    }    }
1629      
   icmp->next= current->icmplist;  
   current->icmplist= icmp;  
   
1630    reset_icmpset();    reset_icmpset();
1631    
1632  }  }

Legend:
Removed from v.1.133  
changed lines
  Added in v.1.134

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26