| 364 | /* *INDENT-ON* */ |
| 365 | |
| 366 | int |
| 367 | main(int argc, char **argv) |
| 368 | { |
| 369 | int flag; |
| 370 | int argerr = 0; |
| 371 | int exit_code = 0; |
| 372 | int option_index = 0; |
| 373 | |
| 374 | pid_file = strdup("/tmp/ClusterMon.pid"); |
| 375 | crm_log_cli_init("crm_mon"); |
| 376 | crm_set_options(NULL, "mode [options]", long_options, |
| 377 | "Provides a summary of cluster's current state." |
| 378 | "\n\nOutputs varying levels of detail in a number of different formats.\n"); |
| 379 | |
| 380 | #ifndef ON_DARWIN |
| 381 | /* prevent zombies */ |
| 382 | signal(SIGCLD, SIG_IGN); |
| 383 | #endif |
| 384 | |
| 385 | if (strcmp(crm_system_name, "crm_mon.cgi") == 0) { |
| 386 | web_cgi = TRUE; |
| 387 | one_shot = TRUE; |
| 388 | } |
| 389 | |
| 390 | while (1) { |
| 391 | flag = crm_get_option(argc, argv, &option_index); |
| 392 | if (flag == -1) |
| 393 | break; |
| 394 | |
| 395 | switch (flag) { |
| 396 | case 'V': |
| 397 | crm_bump_log_level(argc, argv); |
| 398 | break; |
| 399 | case 'Q': |
| 400 | print_last_updated = FALSE; |
| 401 | print_last_change = FALSE; |
| 402 | break; |
| 403 | case 'i': |
| 404 | reconnect_msec = crm_get_msec(optarg); |
| 405 | break; |
| 406 | case 'n': |
| 407 | group_by_node = TRUE; |
| 408 | break; |
| 409 | case 'r': |
| 410 | inactive_resources = TRUE; |
| 411 | break; |
| 412 | case 'W': |
| 413 | watch_fencing = TRUE; |
| 414 | break; |
| 415 | case 'd': |
| 416 | daemonize = TRUE; |
| 417 | break; |
| 418 | case 't': |
| 419 | print_timing = TRUE; |
| 420 | print_operations = TRUE; |
| 421 | break; |
| 422 | case 'o': |
| 423 | print_operations = TRUE; |
nothing calls this directly
no test coverage detected