Skip to content

Instantly share code, notes, and snippets.

@ollyg
Created May 11, 2012 08:26
Show Gist options
  • Save ollyg/2658345 to your computer and use it in GitHub Desktop.
Save ollyg/2658345 to your computer and use it in GitHub Desktop.
Nagios NDO DB Schema for PostgreSQL
CREATE TABLE "nagios_acknowledgements" (
"acknowledgement_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time_usec" integer DEFAULT 0 NOT NULL,
"acknowledgement_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" character varying(255) DEFAULT '' NOT NULL,
"is_sticky" smallint DEFAULT 0 NOT NULL,
"persistent_comment" smallint DEFAULT 0 NOT NULL,
"notify_contacts" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("acknowledgement_id")
);
CREATE TABLE "nagios_commands" (
"command_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"command_line" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("command_id"),
CONSTRAINT "instance_id" UNIQUE ("object_id", "config_type", "instance_id")
);
CREATE TABLE "nagios_commenthistory" (
"commenthistory_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time_usec" integer DEFAULT 0 NOT NULL,
"comment_type" smallint DEFAULT 0 NOT NULL,
"entry_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"comment_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"internal_comment_id" integer DEFAULT 0 NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" text NOT NULL,
"is_persistent" smallint DEFAULT 0 NOT NULL,
"comment_source" smallint DEFAULT 0 NOT NULL,
"expires" smallint DEFAULT 0 NOT NULL,
"expiration_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"deletion_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"deletion_time_usec" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("commenthistory_id"),
CONSTRAINT "instance_id" UNIQUE ("internal_comment_id", "comment_time", "instance_id")
);
CREATE TABLE "nagios_comments" (
"comment_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time_usec" integer DEFAULT 0 NOT NULL,
"comment_type" smallint DEFAULT 0 NOT NULL,
"entry_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"comment_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"internal_comment_id" integer DEFAULT 0 NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" text NOT NULL,
"is_persistent" smallint DEFAULT 0 NOT NULL,
"comment_source" smallint DEFAULT 0 NOT NULL,
"expires" smallint DEFAULT 0 NOT NULL,
"expiration_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
PRIMARY KEY ("comment_id"),
CONSTRAINT "instance_id" UNIQUE ("internal_comment_id", "comment_time", "instance_id")
);
CREATE TABLE "nagios_configfiles" (
"configfile_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"configfile_type" smallint DEFAULT 0 NOT NULL,
"configfile_path" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("configfile_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "configfile_id")
);
CREATE TABLE "nagios_configfilevariables" (
"configfilevariable_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"configfile_id" integer DEFAULT 0 NOT NULL,
"varname" character varying(64) DEFAULT '' NOT NULL,
"varvalue" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("configfilevariable_id")
);
CREATE TABLE "nagios_conninfo" (
"conninfo_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"agent_name" character varying(32) DEFAULT '' NOT NULL,
"agent_version" character varying(8) DEFAULT '' NOT NULL,
"disposition" character varying(16) DEFAULT '' NOT NULL,
"connect_source" character varying(16) DEFAULT '' NOT NULL,
"connect_type" character varying(16) DEFAULT '' NOT NULL,
"connect_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"disconnect_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_checkin_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"data_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"data_end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"bytes_processed" integer DEFAULT 0 NOT NULL,
"lines_processed" integer DEFAULT 0 NOT NULL,
"entries_processed" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("conninfo_id")
);
CREATE TABLE "nagios_contact_addresses" (
"contact_address_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"contact_id" integer DEFAULT 0 NOT NULL,
"address_number" smallint DEFAULT 0 NOT NULL,
"address" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("contact_address_id"),
CONSTRAINT "contact_id" UNIQUE ("contact_id", "address_number")
);
CREATE TABLE "nagios_contact_notificationcommands" (
"contact_notificationcommand_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"contact_id" integer DEFAULT 0 NOT NULL,
"notification_type" smallint DEFAULT 0 NOT NULL,
"command_object_id" integer DEFAULT 0 NOT NULL,
"command_args" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("contact_notificationcommand_id"),
CONSTRAINT "contact_id" UNIQUE ("contact_id", "notification_type", "command_object_id", "command_args")
);
CREATE TABLE "nagios_contactgroup_members" (
"contactgroup_member_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"contactgroup_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("contactgroup_member_id"),
CONSTRAINT "instance_id" UNIQUE ("contactgroup_id", "contact_object_id")
);
CREATE TABLE "nagios_contactgroups" (
"contactgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"contactgroup_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("contactgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "contactgroup_object_id")
);
CREATE TABLE "nagios_contactnotificationmethods" (
"contactnotificationmethod_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"contactnotification_id" integer DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"command_object_id" integer DEFAULT 0 NOT NULL,
"command_args" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("contactnotificationmethod_id"),
CONSTRAINT "instance_id" UNIQUE ("start_time", "contactnotification_id", "instance_id", "start_time_usec")
);
CREATE TABLE "nagios_contactnotifications" (
"contactnotification_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"notification_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("contactnotification_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "contact_object_id", "start_time", "start_time_usec")
);
CREATE TABLE "nagios_contacts" (
"contact_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(64) DEFAULT '' NOT NULL,
"email_address" character varying(255) DEFAULT '' NOT NULL,
"pager_address" character varying(64) DEFAULT '' NOT NULL,
"host_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"service_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"host_notifications_enabled" smallint DEFAULT 0 NOT NULL,
"service_notifications_enabled" smallint DEFAULT 0 NOT NULL,
"can_submit_commands" smallint DEFAULT 0 NOT NULL,
"notify_service_recovery" smallint DEFAULT 0 NOT NULL,
"notify_service_warning" smallint DEFAULT 0 NOT NULL,
"notify_service_unknown" smallint DEFAULT 0 NOT NULL,
"notify_service_critical" smallint DEFAULT 0 NOT NULL,
"notify_service_flapping" smallint DEFAULT 0 NOT NULL,
"notify_service_downtime" smallint DEFAULT 0 NOT NULL,
"notify_host_recovery" smallint DEFAULT 0 NOT NULL,
"notify_host_down" smallint DEFAULT 0 NOT NULL,
"notify_host_unreachable" smallint DEFAULT 0 NOT NULL,
"notify_host_flapping" smallint DEFAULT 0 NOT NULL,
"notify_host_downtime" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("contact_id"),
CONSTRAINT "instance_id" UNIQUE ("contact_object_id", "instance_id", "config_type")
);
CREATE TABLE "nagios_contactstatus" (
"contactstatus_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
"status_update_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"host_notifications_enabled" smallint DEFAULT 0 NOT NULL,
"service_notifications_enabled" smallint DEFAULT 0 NOT NULL,
"last_host_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_service_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"modified_attributes" integer DEFAULT 0 NOT NULL,
"modified_host_attributes" integer DEFAULT 0 NOT NULL,
"modified_service_attributes" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("contactstatus_id"),
CONSTRAINT "contact_object_id" UNIQUE ("contact_object_id")
);
CREATE TABLE "nagios_customvariables" (
"customvariable_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"has_been_modified" smallint DEFAULT 0 NOT NULL,
"varname" character varying(255) DEFAULT '' NOT NULL,
"varvalue" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("customvariable_id"),
CONSTRAINT "object_id_2" UNIQUE ("object_id", "config_type", "varname")
);
CREATE TABLE "nagios_customvariablestatus" (
"customvariablestatus_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"status_update_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"has_been_modified" smallint DEFAULT 0 NOT NULL,
"varname" character varying(255) DEFAULT '' NOT NULL,
"varvalue" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("customvariablestatus_id"),
CONSTRAINT "object_id_2" UNIQUE ("object_id", "varname")
);
CREATE TABLE "nagios_database_version" (
"version" character varying(10)
);
CREATE TABLE "nagios_dbversion" (
"name" character varying(10) DEFAULT '' NOT NULL,
"version" character varying(10) DEFAULT '' NOT NULL
);
CREATE TABLE "nagios_downtimehistory" (
"downtimehistory_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"downtime_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" text NOT NULL,
"internal_downtime_id" integer DEFAULT 0 NOT NULL,
"triggered_by_id" integer DEFAULT 0 NOT NULL,
"is_fixed" smallint DEFAULT 0 NOT NULL,
"duration" smallint DEFAULT 0 NOT NULL,
"scheduled_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"scheduled_end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"was_started" smallint DEFAULT 0 NOT NULL,
"actual_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"actual_start_time_usec" integer DEFAULT 0 NOT NULL,
"actual_end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"actual_end_time_usec" integer DEFAULT 0 NOT NULL,
"was_cancelled" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("downtimehistory_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "object_id", "entry_time", "internal_downtime_id")
);
CREATE TABLE "nagios_eventhandlers" (
"eventhandler_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"eventhandler_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"command_object_id" integer DEFAULT 0 NOT NULL,
"command_args" character varying(255) DEFAULT '' NOT NULL,
"command_line" character varying(255) DEFAULT '' NOT NULL,
"timeout" smallint DEFAULT 0 NOT NULL,
"early_timeout" smallint DEFAULT 0 NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"return_code" smallint DEFAULT 0 NOT NULL,
"output" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("eventhandler_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "object_id", "start_time", "start_time_usec")
);
CREATE TABLE "nagios_externalcommands" (
"externalcommand_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"command_type" smallint DEFAULT 0 NOT NULL,
"command_name" character varying(128) DEFAULT '' NOT NULL,
"command_args" text NOT NULL,
PRIMARY KEY ("externalcommand_id")
);
CREATE TABLE "nagios_flappinghistory" (
"flappinghistory_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"event_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"event_time_usec" integer DEFAULT 0 NOT NULL,
"event_type" smallint DEFAULT 0 NOT NULL,
"reason_type" smallint DEFAULT 0 NOT NULL,
"flapping_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"percent_state_change" double precision DEFAULT '0' NOT NULL,
"low_threshold" double precision DEFAULT '0' NOT NULL,
"high_threshold" double precision DEFAULT '0' NOT NULL,
"comment_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"internal_comment_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("flappinghistory_id")
);
CREATE TABLE "nagios_host_contactgroups" (
"host_contactgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"host_id" integer DEFAULT 0 NOT NULL,
"contactgroup_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("host_contactgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("host_id", "contactgroup_object_id")
);
CREATE TABLE "nagios_host_contacts" (
"host_contact_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"host_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("host_contact_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "host_id", "contact_object_id")
);
CREATE TABLE "nagios_host_parenthosts" (
"host_parenthost_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"host_id" integer DEFAULT 0 NOT NULL,
"parent_host_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("host_parenthost_id"),
CONSTRAINT "instance_id" UNIQUE ("host_id", "parent_host_object_id")
);
CREATE TABLE "nagios_hostchecks" (
"hostcheck_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"check_type" smallint DEFAULT 0 NOT NULL,
"is_raw_check" smallint DEFAULT 0 NOT NULL,
"current_check_attempt" smallint DEFAULT 0 NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"command_object_id" integer DEFAULT 0 NOT NULL,
"command_args" character varying(255) DEFAULT '' NOT NULL,
"command_line" character varying(255) DEFAULT '' NOT NULL,
"timeout" smallint DEFAULT 0 NOT NULL,
"early_timeout" smallint DEFAULT 0 NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"latency" double precision DEFAULT '0' NOT NULL,
"return_code" smallint DEFAULT 0 NOT NULL,
"output" text NOT NULL,
"perfdata" text NOT NULL,
PRIMARY KEY ("hostcheck_id")
);
CREATE TABLE "nagios_hostdependencies" (
"hostdependency_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"dependent_host_object_id" integer DEFAULT 0 NOT NULL,
"dependency_type" smallint DEFAULT 0 NOT NULL,
"inherits_parent" smallint DEFAULT 0 NOT NULL,
"timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"fail_on_up" smallint DEFAULT 0 NOT NULL,
"fail_on_down" smallint DEFAULT 0 NOT NULL,
"fail_on_unreachable" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("hostdependency_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "host_object_id", "dependent_host_object_id", "dependency_type", "inherits_parent", "fail_on_up", "fail_on_down", "fail_on_unreachable")
);
CREATE TABLE "nagios_hostescalation_contactgroups" (
"hostescalation_contactgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"hostescalation_id" integer DEFAULT 0 NOT NULL,
"contactgroup_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("hostescalation_contactgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("hostescalation_id", "contactgroup_object_id")
);
CREATE TABLE "nagios_hostescalation_contacts" (
"hostescalation_contact_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"hostescalation_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("hostescalation_contact_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "hostescalation_id", "contact_object_id")
);
CREATE TABLE "nagios_hostescalations" (
"hostescalation_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"first_notification" smallint DEFAULT 0 NOT NULL,
"last_notification" smallint DEFAULT 0 NOT NULL,
"notification_interval" double precision DEFAULT '0' NOT NULL,
"escalate_on_recovery" smallint DEFAULT 0 NOT NULL,
"escalate_on_down" smallint DEFAULT 0 NOT NULL,
"escalate_on_unreachable" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("hostescalation_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "host_object_id", "timeperiod_object_id", "first_notification", "last_notification")
);
CREATE TABLE "nagios_hostgroup_members" (
"hostgroup_member_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"hostgroup_id" integer DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("hostgroup_member_id"),
CONSTRAINT "instance_id" UNIQUE ("hostgroup_id", "host_object_id")
);
CREATE TABLE "nagios_hostgroups" (
"hostgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"hostgroup_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("hostgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "hostgroup_object_id")
);
CREATE TABLE "nagios_hosts" (
"host_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(64) DEFAULT '' NOT NULL,
"display_name" character varying(64) DEFAULT '' NOT NULL,
"address" character varying(128) DEFAULT '' NOT NULL,
"check_command_object_id" integer DEFAULT 0 NOT NULL,
"check_command_args" character varying(255) DEFAULT '' NOT NULL,
"eventhandler_command_object_id" integer DEFAULT 0 NOT NULL,
"eventhandler_command_args" character varying(255) DEFAULT '' NOT NULL,
"notification_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"check_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"failure_prediction_options" character varying(64) DEFAULT '' NOT NULL,
"check_interval" double precision DEFAULT '0' NOT NULL,
"retry_interval" double precision DEFAULT '0' NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"first_notification_delay" double precision DEFAULT '0' NOT NULL,
"notification_interval" double precision DEFAULT '0' NOT NULL,
"notify_on_down" smallint DEFAULT 0 NOT NULL,
"notify_on_unreachable" smallint DEFAULT 0 NOT NULL,
"notify_on_recovery" smallint DEFAULT 0 NOT NULL,
"notify_on_flapping" smallint DEFAULT 0 NOT NULL,
"notify_on_downtime" smallint DEFAULT 0 NOT NULL,
"stalk_on_up" smallint DEFAULT 0 NOT NULL,
"stalk_on_down" smallint DEFAULT 0 NOT NULL,
"stalk_on_unreachable" smallint DEFAULT 0 NOT NULL,
"flap_detection_enabled" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_up" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_down" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_unreachable" smallint DEFAULT 0 NOT NULL,
"low_flap_threshold" double precision DEFAULT '0' NOT NULL,
"high_flap_threshold" double precision DEFAULT '0' NOT NULL,
"process_performance_data" smallint DEFAULT 0 NOT NULL,
"freshness_checks_enabled" smallint DEFAULT 0 NOT NULL,
"freshness_threshold" smallint DEFAULT 0 NOT NULL,
"passive_checks_enabled" smallint DEFAULT 0 NOT NULL,
"event_handler_enabled" smallint DEFAULT 0 NOT NULL,
"active_checks_enabled" smallint DEFAULT 0 NOT NULL,
"retain_status_information" smallint DEFAULT 0 NOT NULL,
"retain_nonstatus_information" smallint DEFAULT 0 NOT NULL,
"notifications_enabled" smallint DEFAULT 0 NOT NULL,
"obsess_over_host" smallint DEFAULT 0 NOT NULL,
"failure_prediction_enabled" smallint DEFAULT 0 NOT NULL,
"notes" character varying(255) DEFAULT '' NOT NULL,
"notes_url" character varying(255) DEFAULT '' NOT NULL,
"action_url" character varying(255) DEFAULT '' NOT NULL,
"icon_image" character varying(255) DEFAULT '' NOT NULL,
"icon_image_alt" character varying(255) DEFAULT '' NOT NULL,
"vrml_image" character varying(255) DEFAULT '' NOT NULL,
"statusmap_image" character varying(255) DEFAULT '' NOT NULL,
"have_2d_coords" smallint DEFAULT 0 NOT NULL,
"x_2d" smallint DEFAULT 0 NOT NULL,
"y_2d" smallint DEFAULT 0 NOT NULL,
"have_3d_coords" smallint DEFAULT 0 NOT NULL,
"x_3d" double precision DEFAULT '0' NOT NULL,
"y_3d" double precision DEFAULT '0' NOT NULL,
"z_3d" double precision DEFAULT '0' NOT NULL,
PRIMARY KEY ("host_id"),
CONSTRAINT "instance_id" UNIQUE ("host_object_id", "config_type", "instance_id")
);
CREATE TABLE "nagios_hoststatus" (
"hoststatus_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"status_update_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"output" text NOT NULL,
"perfdata" text NOT NULL,
"current_state" smallint DEFAULT 0 NOT NULL,
"has_been_checked" smallint DEFAULT 0 NOT NULL,
"should_be_scheduled" smallint DEFAULT 0 NOT NULL,
"current_check_attempt" smallint DEFAULT 0 NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"last_check" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"next_check" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"check_type" smallint DEFAULT 0 NOT NULL,
"last_state_change" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_hard_state_change" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_hard_state" smallint DEFAULT 0 NOT NULL,
"last_time_up" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_time_down" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_time_unreachable" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"last_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"next_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"no_more_notifications" smallint DEFAULT 0 NOT NULL,
"notifications_enabled" smallint DEFAULT 0 NOT NULL,
"problem_has_been_acknowledged" smallint DEFAULT 0 NOT NULL,
"acknowledgement_type" smallint DEFAULT 0 NOT NULL,
"current_notification_number" smallint DEFAULT 0 NOT NULL,
"passive_checks_enabled" smallint DEFAULT 0 NOT NULL,
"active_checks_enabled" smallint DEFAULT 0 NOT NULL,
"event_handler_enabled" smallint DEFAULT 0 NOT NULL,
"flap_detection_enabled" smallint DEFAULT 0 NOT NULL,
"is_flapping" smallint DEFAULT 0 NOT NULL,
"percent_state_change" double precision DEFAULT '0' NOT NULL,
"latency" double precision DEFAULT '0' NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"scheduled_downtime_depth" smallint DEFAULT 0 NOT NULL,
"failure_prediction_enabled" smallint DEFAULT 0 NOT NULL,
"process_performance_data" smallint DEFAULT 0 NOT NULL,
"obsess_over_host" smallint DEFAULT 0 NOT NULL,
"modified_host_attributes" integer DEFAULT 0 NOT NULL,
"event_handler" character varying(255) DEFAULT '' NOT NULL,
"check_command" character varying(255) DEFAULT '' NOT NULL,
"normal_check_interval" double precision DEFAULT '0' NOT NULL,
"retry_check_interval" double precision DEFAULT '0' NOT NULL,
"check_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("hoststatus_id"),
CONSTRAINT "object_id" UNIQUE ("host_object_id")
);
CREATE TABLE "nagios_instances" (
"instance_id" serial NOT NULL,
"instance_name" character varying(64) DEFAULT '' NOT NULL,
"instance_description" character varying(128) DEFAULT '' NOT NULL,
PRIMARY KEY ("instance_id"),
CONSTRAINT "instance_name" UNIQUE ("instance_name")
);
CREATE TABLE "nagios_logentries" (
"logentry_id" serial NOT NULL,
"instance_id" integer DEFAULT 0 NOT NULL,
"logentry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time_usec" integer DEFAULT 0 NOT NULL,
"logentry_type" integer DEFAULT 0 NOT NULL,
"logentry_data" text NOT NULL,
"realtime_data" smallint DEFAULT 0 NOT NULL,
"inferred_data_extracted" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("logentry_id")
);
CREATE TABLE "nagios_notifications" (
"notification_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"notification_type" smallint DEFAULT 0 NOT NULL,
"notification_reason" smallint DEFAULT 0 NOT NULL,
"notification_number" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"output" character varying(255) DEFAULT '' NOT NULL,
"escalated" smallint DEFAULT 0 NOT NULL,
"contacts_notified" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("notification_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "object_id", "start_time", "start_time_usec")
);
CREATE TABLE "nagios_objects" (
"object_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"objecttype_id" smallint DEFAULT 0 NOT NULL,
"name1" character varying(128) DEFAULT '' NOT NULL,
"name2" character varying(128),
"is_active" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("object_id")
);
CREATE TABLE "nagios_processevents" (
"processevent_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"event_type" smallint DEFAULT 0 NOT NULL,
"event_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"event_time_usec" integer DEFAULT 0 NOT NULL,
"process_id" integer DEFAULT 0 NOT NULL,
"program_name" character varying(16) DEFAULT '' NOT NULL,
"program_version" character varying(20) DEFAULT '' NOT NULL,
"program_date" character varying(10) DEFAULT '' NOT NULL,
PRIMARY KEY ("processevent_id")
);
CREATE TABLE "nagios_programstatus" (
"programstatus_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"status_update_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"program_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"program_end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"is_currently_running" smallint DEFAULT 0 NOT NULL,
"process_id" integer DEFAULT 0 NOT NULL,
"daemon_mode" smallint DEFAULT 0 NOT NULL,
"last_command_check" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_log_rotation" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"notifications_enabled" smallint DEFAULT 0 NOT NULL,
"active_service_checks_enabled" smallint DEFAULT 0 NOT NULL,
"passive_service_checks_enabled" smallint DEFAULT 0 NOT NULL,
"active_host_checks_enabled" smallint DEFAULT 0 NOT NULL,
"passive_host_checks_enabled" smallint DEFAULT 0 NOT NULL,
"event_handlers_enabled" smallint DEFAULT 0 NOT NULL,
"flap_detection_enabled" smallint DEFAULT 0 NOT NULL,
"failure_prediction_enabled" smallint DEFAULT 0 NOT NULL,
"process_performance_data" smallint DEFAULT 0 NOT NULL,
"obsess_over_hosts" smallint DEFAULT 0 NOT NULL,
"obsess_over_services" smallint DEFAULT 0 NOT NULL,
"modified_host_attributes" integer DEFAULT 0 NOT NULL,
"modified_service_attributes" integer DEFAULT 0 NOT NULL,
"global_host_event_handler" character varying(255) DEFAULT '' NOT NULL,
"global_service_event_handler" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("programstatus_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id")
);
CREATE TABLE "nagios_runtimevariables" (
"runtimevariable_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"varname" character varying(64) DEFAULT '' NOT NULL,
"varvalue" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("runtimevariable_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "varname")
);
CREATE TABLE "nagios_scheduleddowntime" (
"scheduleddowntime_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"downtime_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" text NOT NULL,
"internal_downtime_id" integer DEFAULT 0 NOT NULL,
"triggered_by_id" integer DEFAULT 0 NOT NULL,
"is_fixed" smallint DEFAULT 0 NOT NULL,
"duration" smallint DEFAULT 0 NOT NULL,
"scheduled_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"scheduled_end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"was_started" smallint DEFAULT 0 NOT NULL,
"actual_start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"actual_start_time_usec" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("scheduleddowntime_id"),
CONSTRAINT "instance_id" UNIQUE ("object_id", "instance_id", "entry_time", "internal_downtime_id")
);
CREATE TABLE "nagios_schema_version" (
"major_release" character varying(16),
"version" character varying(16)
);
CREATE TABLE "nagios_service_contactgroups" (
"service_contactgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"service_id" integer DEFAULT 0 NOT NULL,
"contactgroup_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("service_contactgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("contactgroup_object_id", "service_id")
);
CREATE TABLE "nagios_service_contacts" (
"service_contact_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"service_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("service_contact_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "service_id", "contact_object_id")
);
CREATE TABLE "nagios_servicechecks" (
"servicecheck_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"check_type" smallint DEFAULT 0 NOT NULL,
"current_check_attempt" smallint DEFAULT 0 NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"command_object_id" integer DEFAULT 0 NOT NULL,
"command_args" character varying(255) DEFAULT '' NOT NULL,
"command_line" character varying(255) DEFAULT '' NOT NULL,
"timeout" smallint DEFAULT 0 NOT NULL,
"early_timeout" smallint DEFAULT 0 NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"latency" double precision DEFAULT '0' NOT NULL,
"return_code" smallint DEFAULT 0 NOT NULL,
"output" text NOT NULL,
"perfdata" text NOT NULL,
PRIMARY KEY ("servicecheck_id")
);
CREATE TABLE "nagios_servicedependencies" (
"servicedependency_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"dependent_service_object_id" integer DEFAULT 0 NOT NULL,
"dependency_type" smallint DEFAULT 0 NOT NULL,
"inherits_parent" smallint DEFAULT 0 NOT NULL,
"timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"fail_on_ok" smallint DEFAULT 0 NOT NULL,
"fail_on_warning" smallint DEFAULT 0 NOT NULL,
"fail_on_unknown" smallint DEFAULT 0 NOT NULL,
"fail_on_critical" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("servicedependency_id"),
CONSTRAINT "instance_id" UNIQUE ("service_object_id", "config_type", "dependent_service_object_id", "dependency_type", "inherits_parent", "fail_on_ok", "fail_on_warning", "fail_on_unknown", "fail_on_critical", "instance_id")
);
CREATE TABLE "nagios_serviceescalation_contactgroups" (
"serviceescalation_contactgroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"serviceescalation_id" integer DEFAULT 0 NOT NULL,
"contactgroup_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("serviceescalation_contactgroup_id"),
CONSTRAINT "instance_id" UNIQUE ("serviceescalation_id", "contactgroup_object_id")
);
CREATE TABLE "nagios_serviceescalation_contacts" (
"serviceescalation_contact_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"serviceescalation_id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("serviceescalation_contact_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "serviceescalation_id", "contact_object_id")
);
CREATE TABLE "nagios_serviceescalations" (
"serviceescalation_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"first_notification" smallint DEFAULT 0 NOT NULL,
"last_notification" smallint DEFAULT 0 NOT NULL,
"notification_interval" double precision DEFAULT '0' NOT NULL,
"escalate_on_recovery" smallint DEFAULT 0 NOT NULL,
"escalate_on_warning" smallint DEFAULT 0 NOT NULL,
"escalate_on_unknown" smallint DEFAULT 0 NOT NULL,
"escalate_on_critical" smallint DEFAULT 0 NOT NULL,
PRIMARY KEY ("serviceescalation_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "service_object_id", "timeperiod_object_id", "first_notification", "last_notification")
);
CREATE TABLE "nagios_servicegroup_members" (
"servicegroup_member_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"servicegroup_id" integer DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("servicegroup_member_id"),
CONSTRAINT "instance_id" UNIQUE ("servicegroup_id", "service_object_id")
);
CREATE TABLE "nagios_servicegroups" (
"servicegroup_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"servicegroup_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("servicegroup_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "servicegroup_object_id")
);
CREATE TABLE "nagios_services" (
"service_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"host_object_id" integer DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"display_name" character varying(64) DEFAULT '' NOT NULL,
"check_command_object_id" integer DEFAULT 0 NOT NULL,
"check_command_args" character varying(255) DEFAULT '' NOT NULL,
"eventhandler_command_object_id" integer DEFAULT 0 NOT NULL,
"eventhandler_command_args" character varying(255) DEFAULT '' NOT NULL,
"notification_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"check_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"failure_prediction_options" character varying(64) DEFAULT '' NOT NULL,
"check_interval" double precision DEFAULT '0' NOT NULL,
"retry_interval" double precision DEFAULT '0' NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"first_notification_delay" double precision DEFAULT '0' NOT NULL,
"notification_interval" double precision DEFAULT '0' NOT NULL,
"notify_on_warning" smallint DEFAULT 0 NOT NULL,
"notify_on_unknown" smallint DEFAULT 0 NOT NULL,
"notify_on_critical" smallint DEFAULT 0 NOT NULL,
"notify_on_recovery" smallint DEFAULT 0 NOT NULL,
"notify_on_flapping" smallint DEFAULT 0 NOT NULL,
"notify_on_downtime" smallint DEFAULT 0 NOT NULL,
"stalk_on_ok" smallint DEFAULT 0 NOT NULL,
"stalk_on_warning" smallint DEFAULT 0 NOT NULL,
"stalk_on_unknown" smallint DEFAULT 0 NOT NULL,
"stalk_on_critical" smallint DEFAULT 0 NOT NULL,
"is_volatile" smallint DEFAULT 0 NOT NULL,
"flap_detection_enabled" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_ok" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_warning" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_unknown" smallint DEFAULT 0 NOT NULL,
"flap_detection_on_critical" smallint DEFAULT 0 NOT NULL,
"low_flap_threshold" double precision DEFAULT '0' NOT NULL,
"high_flap_threshold" double precision DEFAULT '0' NOT NULL,
"process_performance_data" smallint DEFAULT 0 NOT NULL,
"freshness_checks_enabled" smallint DEFAULT 0 NOT NULL,
"freshness_threshold" smallint DEFAULT 0 NOT NULL,
"passive_checks_enabled" smallint DEFAULT 0 NOT NULL,
"event_handler_enabled" smallint DEFAULT 0 NOT NULL,
"active_checks_enabled" smallint DEFAULT 0 NOT NULL,
"retain_status_information" smallint DEFAULT 0 NOT NULL,
"retain_nonstatus_information" smallint DEFAULT 0 NOT NULL,
"notifications_enabled" smallint DEFAULT 0 NOT NULL,
"obsess_over_service" smallint DEFAULT 0 NOT NULL,
"failure_prediction_enabled" smallint DEFAULT 0 NOT NULL,
"notes" character varying(255) DEFAULT '' NOT NULL,
"notes_url" character varying(255) DEFAULT '' NOT NULL,
"action_url" character varying(255) DEFAULT '' NOT NULL,
"icon_image" character varying(255) DEFAULT '' NOT NULL,
"icon_image_alt" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("service_id"),
CONSTRAINT "instance_id" UNIQUE ("service_object_id", "config_type", "instance_id")
);
CREATE TABLE "nagios_servicestatus" (
"servicestatus_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"status_update_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"output" text NOT NULL,
"perfdata" text NOT NULL,
"current_state" smallint DEFAULT 0 NOT NULL,
"has_been_checked" smallint DEFAULT 0 NOT NULL,
"should_be_scheduled" smallint DEFAULT 0 NOT NULL,
"current_check_attempt" smallint DEFAULT 0 NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"last_check" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"next_check" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"check_type" smallint DEFAULT 0 NOT NULL,
"last_state_change" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_hard_state_change" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_hard_state" smallint DEFAULT 0 NOT NULL,
"last_time_ok" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_time_warning" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_time_unknown" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"last_time_critical" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"last_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"next_notification" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"no_more_notifications" smallint DEFAULT 0 NOT NULL,
"notifications_enabled" smallint DEFAULT 0 NOT NULL,
"problem_has_been_acknowledged" smallint DEFAULT 0 NOT NULL,
"acknowledgement_type" smallint DEFAULT 0 NOT NULL,
"current_notification_number" smallint DEFAULT 0 NOT NULL,
"passive_checks_enabled" smallint DEFAULT 0 NOT NULL,
"active_checks_enabled" smallint DEFAULT 0 NOT NULL,
"event_handler_enabled" smallint DEFAULT 0 NOT NULL,
"flap_detection_enabled" smallint DEFAULT 0 NOT NULL,
"is_flapping" smallint DEFAULT 0 NOT NULL,
"percent_state_change" double precision DEFAULT '0' NOT NULL,
"latency" double precision DEFAULT '0' NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"scheduled_downtime_depth" smallint DEFAULT 0 NOT NULL,
"failure_prediction_enabled" smallint DEFAULT 0 NOT NULL,
"process_performance_data" smallint DEFAULT 0 NOT NULL,
"obsess_over_service" smallint DEFAULT 0 NOT NULL,
"modified_service_attributes" integer DEFAULT 0 NOT NULL,
"event_handler" character varying(255) DEFAULT '' NOT NULL,
"check_command" character varying(255) DEFAULT '' NOT NULL,
"normal_check_interval" double precision DEFAULT '0' NOT NULL,
"retry_check_interval" double precision DEFAULT '0' NOT NULL,
"check_timeperiod_object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("servicestatus_id"),
CONSTRAINT "object_id" UNIQUE ("service_object_id")
);
CREATE TABLE "nagios_statehistory" (
"statehistory_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"state_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"state_time_usec" integer DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"state_change" smallint DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"state_type" smallint DEFAULT 0 NOT NULL,
"current_check_attempt" smallint DEFAULT 0 NOT NULL,
"max_check_attempts" smallint DEFAULT 0 NOT NULL,
"last_state" smallint DEFAULT -1 NOT NULL,
"last_hard_state" smallint DEFAULT -1 NOT NULL,
"output" text NOT NULL,
PRIMARY KEY ("statehistory_id")
);
CREATE TABLE "nagios_systemcommands" (
"systemcommand_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"start_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"start_time_usec" integer DEFAULT 0 NOT NULL,
"end_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"end_time_usec" integer DEFAULT 0 NOT NULL,
"command_line" character varying(255) DEFAULT '' NOT NULL,
"timeout" smallint DEFAULT 0 NOT NULL,
"early_timeout" smallint DEFAULT 0 NOT NULL,
"execution_time" double precision DEFAULT '0' NOT NULL,
"return_code" smallint DEFAULT 0 NOT NULL,
"output" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("systemcommand_id"),
CONSTRAINT "instance_id" UNIQUE ("start_time", "instance_id", "start_time_usec")
);
CREATE TABLE "nagios_timedeventqueue" (
"timedeventqueue_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"event_type" smallint DEFAULT 0 NOT NULL,
"queued_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"queued_time_usec" integer DEFAULT 0 NOT NULL,
"scheduled_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"recurring_event" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("timedeventqueue_id")
);
CREATE TABLE "nagios_timedevents" (
"timedevent_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"event_type" smallint DEFAULT 0 NOT NULL,
"queued_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"queued_time_usec" integer DEFAULT 0 NOT NULL,
"event_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"event_time_usec" integer DEFAULT 0 NOT NULL,
"scheduled_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"recurring_event" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"deletion_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"deletion_time_usec" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("timedevent_id"),
CONSTRAINT "instance_id" UNIQUE ("scheduled_time", "instance_id", "event_type", "object_id")
);
CREATE TABLE "nagios_timeperiod_timeranges" (
"timeperiod_timerange_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"timeperiod_id" integer DEFAULT 0 NOT NULL,
"day" smallint DEFAULT 0 NOT NULL,
"start_sec" integer DEFAULT 0 NOT NULL,
"end_sec" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("timeperiod_timerange_id"),
CONSTRAINT "instance_id" UNIQUE ("timeperiod_id", "day", "start_sec", "end_sec")
);
CREATE TABLE "nagios_timeperiods" (
"timeperiod_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"config_type" smallint DEFAULT 0 NOT NULL,
"timeperiod_object_id" integer DEFAULT 0 NOT NULL,
"alias" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("timeperiod_id"),
CONSTRAINT "instance_id" UNIQUE ("instance_id", "config_type", "timeperiod_object_id")
);
CREATE TABLE "opsview_contact_hosts" (
"contactid" integer,
"host_object_id" integer
);
CREATE TABLE "opsview_contact_objects" (
"contactid" integer NOT NULL,
"object_id" integer NOT NULL
);
CREATE TABLE "opsview_contact_services" (
"contactid" integer NOT NULL,
"service_object_id" integer NOT NULL
);
CREATE TABLE "opsview_contacts" (
"id" integer DEFAULT 0 NOT NULL,
"contact_object_id" integer,
"name" character varying(128) NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_database_version" (
"version" character varying(10)
);
CREATE TABLE "opsview_host_objects" (
"host_object_id" integer DEFAULT 0 NOT NULL,
"hostname" character varying(64) DEFAULT '' NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"name2" character varying(128),
"perfdata_available" smallint DEFAULT 0 NOT NULL,
"markdown_filter" smallint DEFAULT 0 NOT NULL,
"servicecheck_id" integer DEFAULT 0 NOT NULL,
"servicegroup_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("object_id")
);
CREATE TABLE "opsview_host_services" (
"host_object_id" integer DEFAULT 0 NOT NULL,
"hostname" character varying(64) DEFAULT '' NOT NULL,
"service_object_id" integer DEFAULT 0 NOT NULL,
"servicename" character varying(128) DEFAULT '' NOT NULL,
"perfdata_available" smallint DEFAULT 0 NOT NULL,
"markdown_filter" smallint DEFAULT 0 NOT NULL,
"servicecheck_id" integer DEFAULT 0 NOT NULL,
"servicegroup_id" integer DEFAULT 0 NOT NULL,
"icon_filename" character varying(128),
PRIMARY KEY ("service_object_id")
);
CREATE TABLE "opsview_hostgroup_hosts" (
"hostgroup_id" integer,
"host_object_id" integer
);
CREATE TABLE "opsview_hostgroups" (
"id" integer DEFAULT 0 NOT NULL,
"parentid" integer DEFAULT 1,
"name" character varying(128) DEFAULT '' NOT NULL,
"lft" integer,
"rgt" integer,
"matpath" text NOT NULL,
"matpathid" text NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_hosts" (
"id" integer DEFAULT 0 NOT NULL,
"opsview_host_id" integer DEFAULT 0 NOT NULL,
"name" character varying(64) DEFAULT '' NOT NULL,
"ip" character varying(255) DEFAULT '' NOT NULL,
"alias" character varying(255) DEFAULT '' NOT NULL,
"icon_filename" character varying(128) DEFAULT '' NOT NULL,
"hostgroup_id" integer DEFAULT 0 NOT NULL,
"monitored_by" integer DEFAULT 0 NOT NULL,
"primary_node" integer,
"secondary_node" integer,
"num_interfaces" integer DEFAULT 0 NOT NULL,
"num_services" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_monitoringclusternodes" (
"id" integer DEFAULT 0 NOT NULL,
"name" character varying(64) DEFAULT '' NOT NULL,
"ip" character varying(255) DEFAULT '' NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_monitoringclusters" (
"id" integer DEFAULT 0 NOT NULL,
"name" character varying(64) DEFAULT '' NOT NULL,
"hostname" character varying(64),
"ip" character varying(255),
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_performance_metrics" (
"service_object_id" integer DEFAULT 0,
"id" serial NOT NULL,
"hostname" character varying(64) DEFAULT '' NOT NULL,
"servicename" character varying(128) DEFAULT '' NOT NULL,
"metricname" character varying(128) DEFAULT '' NOT NULL,
"uom" character varying(64),
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_servicechecks" (
"id" integer NOT NULL,
"name" character varying(64) DEFAULT '' NOT NULL,
"description" character varying(128) DEFAULT '' NOT NULL,
"multiple" smallint DEFAULT 0 NOT NULL,
"active" smallint DEFAULT 0 NOT NULL,
"markdown_filter" smallint DEFAULT 0 NOT NULL,
"cascaded_from" integer DEFAULT 0 NOT NULL,
"servicegroup_id" integer DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_servicegroups" (
"id" integer NOT NULL,
"name" character varying(128) DEFAULT '' NOT NULL,
PRIMARY KEY ("id")
);
CREATE TABLE "opsview_viewports" (
"viewportid" integer DEFAULT 0 NOT NULL,
"keyword" character varying(128) DEFAULT '' NOT NULL,
"hostname" character varying(64) DEFAULT '' NOT NULL,
"servicename" character varying(128),
"host_object_id" integer DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL
);
CREATE TABLE "schema_version" (
"major_release" character varying(16),
"version" character varying(16)
);
CREATE TABLE "snmptrapdebug" (
"id" serial NOT NULL,
"starttime" integer,
"duration" numeric,
"packet" text,
PRIMARY KEY ("id")
);
CREATE TABLE "snmptrapexceptions" (
"id" serial NOT NULL,
"time" character varying(16),
"hostip" character varying(16),
"trapname" character varying(128),
"reason" integer,
"arg1" character varying(8),
"packet" text,
"trapdebug" integer,
"hostname" character varying(64),
PRIMARY KEY ("id")
);
CREATE TABLE "snmptrapruledebug" (
"id" serial NOT NULL,
"trap" integer DEFAULT 0 NOT NULL,
"servicecheck" integer DEFAULT 0 NOT NULL,
"expandedrule" text,
"result" integer,
PRIMARY KEY ("id")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment