Back to index

nagios-plugins  1.4.16
Functions | Variables
check_dummy.c File Reference
#include "common.h"
#include "utils.h"

Go to the source code of this file.

Functions

void print_help (void)
void print_usage (void)
int main (int argc, char **argv)

Variables

const char * progname = "check_dummy"
const char * copyright = "1999-2007"
const char * email = "nagiosplug-devel@lists.sourceforge.net"

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 43 of file check_dummy.c.

{
  int result = STATE_UNKNOWN;

  setlocale (LC_ALL, "");
  bindtextdomain (PACKAGE, LOCALEDIR);
  textdomain (PACKAGE);

  if (argc < 2)
    usage4 (_("Could not parse arguments"));
  else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
    print_revision (progname, NP_VERSION);
    exit (STATE_OK);
  }
  else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) {
    print_help ();
    exit (STATE_OK);
  }
  else if (!is_integer (argv[1]))
    usage4 (_("Arguments to check_dummy must be an integer"));
  else
    result = atoi (argv[1]);

  switch (result) {
  case STATE_OK:
    printf (_("OK"));
    break;
  case STATE_WARNING:
    printf (_("WARNING"));
    break;
  case STATE_CRITICAL:
    printf (_("CRITICAL"));
    break;
  case STATE_UNKNOWN:
    printf (_("UNKNOWN"));
    break;
  default:
    printf (_("UNKNOWN"));
    printf (": ");
    printf (_("Status %d is not a supported error state\n"), result);
    return STATE_UNKNOWN;
  }

  if (argc >= 3)
    printf (": %s", argv[2]);

  printf("\n");

  return result;
}

Here is the call graph for this function:

void print_help ( void  )
void print_usage ( void  )

Definition at line 389 of file check_cpqarray.c.

{
  printf("cpqarrayd [options]\n");
  printf("   -h         prints this text\n");
  printf("   -d         enables debugging\n");
}

Variable Documentation

const char* copyright = "1999-2007"

Definition at line 32 of file check_dummy.c.

const char* email = "nagiosplug-devel@lists.sourceforge.net"

Definition at line 33 of file check_dummy.c.

const char* progname = "check_dummy"

Definition at line 31 of file check_dummy.c.