/[monit]/monit/validate.c
ViewVC logotype

Diff of /monit/validate.c

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

revision 1.137 by hauk, Tue Apr 12 22:15:58 2005 UTC revision 1.138 by martinp, Wed Apr 13 07:37:46 2005 UTC
# Line 290  int check_file(Service_T s) { Line 290  int check_file(Service_T s) {
290      s->inf->st_gid= stat_buf.st_gid;      s->inf->st_gid= stat_buf.st_gid;
291      s->inf->st_size= stat_buf.st_size;      s->inf->st_size= stat_buf.st_size;
292      s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime);      s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime);
293        DEBUG("'%s' file existence check passed\n", s->name);
294      Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST,      Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST,
295        "'%s' file exist", s->name);        "'%s' file exist", s->name);
296    }    }
# Line 299  int check_file(Service_T s) { Line 300  int check_file(Service_T s) {
300        "'%s' is not regular file", s->name);        "'%s' is not regular file", s->name);
301      return FALSE;      return FALSE;
302    } else {    } else {
303        DEBUG("'%s' is regular file\n", s->name);
304      Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID,      Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID,
305        "'%s' is regular file", s->name);        "'%s' is regular file", s->name);
306    }    }
# Line 345  int check_directory(Service_T s) { Line 347  int check_directory(Service_T s) {
347      s->inf->st_uid= stat_buf.st_uid;      s->inf->st_uid= stat_buf.st_uid;
348      s->inf->st_gid= stat_buf.st_gid;      s->inf->st_gid= stat_buf.st_gid;
349      s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime);      s->inf->timestamp= MAX(stat_buf.st_mtime, stat_buf.st_ctime);
350        DEBUG("'%s' directory existence check passed\n", s->name);
351      Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST,      Event_post(s, EVENT_NONEXIST, FALSE, s->action_NONEXIST,
352        "'%s' directory exist", s->name);        "'%s' directory exist", s->name);
353    }    }
# Line 354  int check_directory(Service_T s) { Line 357  int check_directory(Service_T s) {
357        "'%s' is not directory", s->name);        "'%s' is not directory", s->name);
358      return FALSE;      return FALSE;
359    } else {    } else {
360        DEBUG("'%s' is directory\n", s->name);
361      Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID,      Event_post(s, EVENT_INVALID, FALSE, s->action_INVALID,
362        "'%s' is directory", s->name);        "'%s' is directory", s->name);
363    }    }
# Line 543  static void check_process_pid(Service_T Line 547  static void check_process_pid(Service_T
547      Event_post(s, EVENT_CHANGED, TRUE, s->action_PID,      Event_post(s, EVENT_CHANGED, TRUE, s->action_PID,
548        "'%s' process PID changed to %d", s->name, s->inf->pid);        "'%s' process PID changed to %d", s->name, s->inf->pid);
549    } else {    } else {
550        DEBUG("'%s' PID has not changed since last cycle\n", s->name);
551      Event_post(s, EVENT_CHANGED, FALSE, s->action_PID,      Event_post(s, EVENT_CHANGED, FALSE, s->action_PID,
552        "'%s' PID has not changed", s->name);        "'%s' PID has not changed", s->name);
553    }    }
# Line 564  static void check_process_ppid(Service_T Line 569  static void check_process_ppid(Service_T
569      Event_post(s, EVENT_CHANGED, TRUE, s->action_PPID,      Event_post(s, EVENT_CHANGED, TRUE, s->action_PPID,
570        "'%s' process PPID changed to %d", s->name, s->inf->ppid);        "'%s' process PPID changed to %d", s->name, s->inf->ppid);
571    } else {    } else {
572        DEBUG("'%s' PPID has not changed since last cycle\n", s->name);
573      Event_post(s, EVENT_CHANGED, FALSE, s->action_PPID,      Event_post(s, EVENT_CHANGED, FALSE, s->action_PPID,
574        "'%s' PPID has not changed", s->name);        "'%s' PPID has not changed", s->name);
575    }    }
# Line 811  static void check_perm(Service_T s) { Line 817  static void check_perm(Service_T s) {
817        "'%s' permission test failed for %s -- current permission is %o",        "'%s' permission test failed for %s -- current permission is %o",
818        s->name, s->path, s->inf->st_mode&07777);        s->name, s->path, s->inf->st_mode&07777);
819    } else {    } else {
820      DEBUG("'%s' file permission check passed [current permission=%o]\n",      DEBUG("'%s' permission check passed [current permission=%o]\n",
821        s->name, s->inf->st_mode&07777);        s->name, s->inf->st_mode&07777);
822      Event_post(s, EVENT_PERMISSION, FALSE, s->perm->action,      Event_post(s, EVENT_PERMISSION, FALSE, s->perm->action,
823        "'%s' permission passed", s->name);        "'%s' permission passed", s->name);
# Line 831  static void check_uid(Service_T s) { Line 837  static void check_uid(Service_T s) {
837        "'%s' uid test failed for %s -- current uid is %d",        "'%s' uid test failed for %s -- current uid is %d",
838        s->name, s->path, (int)s->inf->st_uid);        s->name, s->path, (int)s->inf->st_uid);
839    } else {    } else {
840      DEBUG("'%s' device uid check passed [current uid=%d]\n", s->name,      DEBUG("'%s' uid check passed [current uid=%d]\n", s->name,
841            (int)s->inf->st_uid);            (int)s->inf->st_uid);
842      Event_post(s, EVENT_UID, FALSE, s->uid->action, "'%s' uid passed", s->name);      Event_post(s, EVENT_UID, FALSE, s->uid->action, "'%s' uid passed", s->name);
843    }    }
# Line 851  static void check_gid(Service_T s) { Line 857  static void check_gid(Service_T s) {
857        "'%s' gid test failed for %s -- current gid is %d",        "'%s' gid test failed for %s -- current gid is %d",
858        s->name, s->path, (int)s->inf->st_gid);        s->name, s->path, (int)s->inf->st_gid);
859    } else {    } else {
860      DEBUG("'%s' device gid check passed [current gid=%d]\n", s->name,      DEBUG("'%s' gid check passed [current gid=%d]\n", s->name,
861            (int)s->inf->st_gid);            (int)s->inf->st_gid);
862      Event_post(s, EVENT_GID, FALSE, s->gid->action, "'%s' gid passed", s->name);      Event_post(s, EVENT_GID, FALSE, s->gid->action, "'%s' gid passed", s->name);
863    }    }

Legend:
Removed from v.1.137  
changed lines
  Added in v.1.138

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