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

Diff of /monit/util.c

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

revision 1.44 by rory, Mon Nov 25 23:44:25 2002 UTC revision 1.45 by martinp, Fri Nov 29 13:38:51 2002 UTC
# Line 430  void printprocess(Process_T p) { Line 430  void printprocess(Process_T p) {
430    Mail_T r;    Mail_T r;
431    Resource_T q;    Resource_T q;
432    Checksum_T c;    Checksum_T c;
433      Timestamp_T t;
434    
435    ASSERT(p);    ASSERT(p);
436    
# Line 447  void printprocess(Process_T p) { Line 448  void printprocess(Process_T p) {
448            
449    }    }
450    
   if(! p->checksumlist) {  
       
     printf(" %-20s = (not defined)\n", "Other checksum");  
       
   }  
   
451    if(! p->portlist) {    if(! p->portlist) {
452            
453      printf(" %-20s = (not defined)\n", "Host:Port");      printf(" %-20s = (not defined)\n", "Host:Port");
# Line 496  void printprocess(Process_T p) { Line 491  void printprocess(Process_T p) {
491    
492    }    }
493        
494      for(t= p->timestamplist; t; t= t->next) {
495        
496        printf(" %-20s = if %s %s %d second(s) then %s\n",
497               "Timestamp",
498               t->pathname,
499               operatornames[t->operator],
500               t->time,
501               actionnames[t->action]);
502        
503      }
504    
505    if(p->def_timeout) {    if(p->def_timeout) {
506            
507      printf(" %-20s = Do timeout if %d restart within %d cycles\n",      printf(" %-20s = Do timeout if %d restart within %d cycles\n",
# Line 526  void printprocess(Process_T p) { Line 532  void printprocess(Process_T p) {
532             r->alert_on_resource?"yes":"no");             r->alert_on_resource?"yes":"no");
533      printf("   %-18s = %s\n", "alert on stop",      printf("   %-18s = %s\n", "alert on stop",
534             r->alert_on_stop?"yes":"no");             r->alert_on_stop?"yes":"no");
535        printf("   %-18s = %s\n", "alert on timestamp",
536               r->alert_on_timestamp?"yes":"no");
537    
538    }    }
539    
# Line 696  int is_process_running(Process_T p) { Line 704  int is_process_running(Process_T p) {
704            
705      if((kill_return= getpgid(pid)) > 0 || errno == EPERM)      if((kill_return= getpgid(pid)) > 0 || errno == EPERM)
706                    
707          return pid;        return pid;
708            
709    }    }
710    
# Line 779  char *get_process_uptime(char *pidfile) Line 787  char *get_process_uptime(char *pidfile)
787    
788    ASSERT(pidfile);    ASSERT(pidfile);
789    
790    ctime = (pidfile?file_changedtime(pidfile):0);    if( (ctime= get_timestamp(pidfile, S_IFREG)) ) {
   
   if(ctime) {  
791            
792      time_t now= time(&now);      time_t now= time(&now);
793      time_t since= now-ctime;      time_t since= now-ctime;
# Line 846  int set_md5sum(char **dest, char *file) Line 852  int set_md5sum(char **dest, char *file)
852    ASSERT(file);    ASSERT(file);
853    
854    if(! (*dest= get_md5sum(file)))    if(! (*dest= get_md5sum(file)))
855        return FALSE;      return FALSE;
856        
857    return TRUE;    return TRUE;
858    

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

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