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

Diff of /monit/monitor.c

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

revision 1.58 by chopp, Wed Aug 13 22:18:42 2003 UTC revision 1.59 by martinp, Wed Aug 27 01:42:40 2003 UTC
# Line 385  static void do_action(char **args) { Line 385  static void do_action(char **args) {
385        goto error;        goto error;
386      }      }
387            
388      } else if(IS(action, "monitor")) {
389        
390        if(P) {
391          if(! IS(P, "all")) {
392            if(exist_daemon()) {
393              d_check_service(P, "monitor");
394            } else {
395              check_service(P, "monitor");
396            }
397          } else {
398            if(Run.mygroup)
399                control_group(Run.mygroup, "monitor");
400            else
401                control("monitor");
402          }
403        } else {
404          goto error;
405        }
406        
407      } else if(IS(action, "unmonitor")) {
408        
409        if(P) {
410          if(! IS(P, "all")) {
411            if(exist_daemon()) {
412              d_check_service(P, "unmonitor");
413            } else {
414              check_service(P, "unmonitor");
415            }
416          } else {
417            if(Run.mygroup)
418                control_group(Run.mygroup, "unmonitor");
419            else
420                control("unmonitor");
421          }
422        } else {
423          goto error;
424        }
425        
426    } else if(IS(action, "reload")) {    } else if(IS(action, "reload")) {
427            
428      log("Reinitializing monit daemon\n", prog);      log("Reinitializing monit daemon\n", prog);
# Line 396  static void do_action(char **args) { Line 434  static void do_action(char **args) {
434        if(! IS(P, "all")) {        if(! IS(P, "all")) {
435          if(! exist_service(P)) {          if(! exist_service(P)) {
436                        
437            log("%s: Cannot restart program '%s' -- not found in %s\n",            log("%s: Cannot restart service '%s' -- not found in %s\n",
438                  prog, P, Run.controlfile);                  prog, P, Run.controlfile);
439                        
440            return;            return;
# Line 713  static void help() { Line 751  static void help() {
751    printf(" -v           Verbose mode, work noisy (diagnostic output)\n");    printf(" -v           Verbose mode, work noisy (diagnostic output)\n");
752    printf(" -V           Print version number and patchlevel\n");    printf(" -V           Print version number and patchlevel\n");
753    printf(" -h           Print this text\n");    printf(" -h           Print this text\n");
754    printf("Optional action arguments for non-daemon mode are as follows:\n");    printf(
755    printf(" start all    - Start all programs listed in the control file\n");      "Optional action arguments for non-daemon mode are as follows:\n"
756    printf(" start name   - Only start the named program in the control file\n");      " start all      - Start all services\n"
757    printf(" stop all     - Stop all programs listed in the control file\n");      " start name     - Only start the named service\n"
758    printf(" stop name    - Only stop the named program in the control file\n");      " stop all       - Stop all services\n"
759    printf(" reload       - Reinitialize monit\n");      " stop name      - Only stop the named service\n"
760    printf(" restart all  - Stop and start all programs\n");      " restart all    - Stop and start all services\n"
761    printf(" restart name - Only restart the named program in the control file\n");      " restart name   - Only restart the named service\n"
762    printf(" status       - Print status information for each program\n");      " monitor all    - Enable monitoring of all services\n"
763    printf(" quit         - Kill monit daemon process\n");      " monitor name   - Only enable monitoring of the named\n"
764    printf(" validate     - Check all programs and start if not running.\n");      " unmonitor all  - Disable monitoring of all services\n"
765        " unmonitor name - Only disable monitoring of the named service\n"
766        " reload         - Reinitialize monit\n"
767        " status         - Print status information for each service\n"
768        " quit           - Kill monit daemon process\n"
769        " validate       - Check all services and start if not running\n"
770        "\n"
771        " (all commands operate on services defined in control file)\n"
772      );
773    
774  }  }
775    

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59

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