# Copyright (c) 2000-2002 Carnegie Mellon University. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # 3. The name "Carnegie Mellon University" must not be used to endorse or # promote products derived from this software without prior written # permission. For permission or any legal details, please contact: # Office of Technology Transfer # Carnegie Mellon University # 5000 Forbes Avenue # Pittsburgh, PA 15213-3890 # (412) 268-4387, fax: (412) 268-7395 # tech-transfer@andrew.cmu.edu # # 4. Redistributions of any form whatsoever must retain the following # acknowledgment: "This product includes software developed by Computing # Services at Carnegie Mellon University (http://www.cmu.edu/computing/)." # # CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, # IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY SPECIAL, # INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # This file contains some dummy data for a slave/master mon setup. CONNECT netsage; # Add the 'netsage' user, for use by automated scripts. INSERT INTO users (name) VALUES ("netsage"); # Give the 'netsage' user full database access. INSERT INTO permissions (user, level) VALUES (1, 9); # Hosts, 2 MON servers, one slave, one master, and 3 dummy servers to # be monitored INSERT INTO hosts (host_name, ip_address, external) VALUES ('slave1.net.cmu.edu', INET_ATON("10.0.0.1"), 0), ('dummyserver1.net.cmu.edu', INET_ATON("10.0.0.2"), 0), ('dummyserver2.andrew.cmu.edu', INET_ATON("10.0.0.3"), 0), ('master.net.cmu.edu', INET_ATON("10.0.0.4"), 0), ('dummyserver3.net.cmu.edu', INET_ATON("10.0.0.5"), 0); # Our two hostgroups INSERT INTO hostgroups (name, external) VALUES ('testgroup-1', 0), ('testgroup-2-with-overrides', 0); # Put dummyservers 1 and 2 ine one group, and 1 and 3 in another group INSERT INTO hostgroup_memberships (hostgroup, host) VALUES (1, 2), (1, 3), (2, 2), (2, 5); # Our only server type for now is MON INSERT INTO server_types (software, software_version, description, external) VALUES ('MON', '0.99.2', 'MON host', 0); # Bind the two hosts defined above to be MON servers INSERT INTO servers (name, host, description, server_type, external) VALUES ('MON Slave Server', 1, 'This server does the actual monitoring', 1, 0), ('MON Master Server', 4, 'This server sends the alerts, and serves data to clients', 1, 0); # Insert a subset of attribute types INSERT INTO attribute_types (name, parent_table, value_has_action, value_has_string, value_string_format, value_has_number, value_has_time, value_has_boolean, value_has_host, value_has_period, value_has_range, external) VALUES ("interval", "services,service_types", 0, 0, NULL, 0, 1, 0, 0, 0, 0, 0), ("monitoraction", "service_types", 1, 0, NULL, 0, 0, 0, 0, 0, 0, 0), ("alertevery", "alert_period", 0, 0, NULL, 0, 1, 1, 0, 0, 0, 0), ("alertafter", "alert_period", 0, 0, NULL, 1, 1, 0, 0, 0, 0, 0), ("alertaction", "alert_period", 1, 1, ".*", 0, 0, 0, 0, 0, 1, 0), ("upalertaction", "alert_period", 1, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("randomstart", "", 0, 0, NULL, 0, 1, 0, 0, 0, 0, 0), ("basedir", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("alertdir", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("mondir", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("statedir", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("logdir", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("dtlogfile", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("historicfile", "", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0), ("histlength", "", 0, 0, NULL, 1, 0, 0, 0, 0, 0, 0), ("dtlogging", "", 0, 0, NULL, 0, 0, 1, 0, 0, 0, 0), ("monitorarguments", "services,service_types", 0, 1, ".*", 0, 0, 0, 0, 0, 0, 0); # Here we list the valid actions (monitors and alerts) to be used later INSERT INTO actions (name, external) VALUES ("qpage.alert", 0), ("mail.alert", 0), ("fping.monitor", 0), ("http.monitor", 0); # Here we bind those valid actions to what types of attributes can have # them. (i.e. alerts vs. monitors) INSERT INTO action_attribute_types (action, attribute_type) VALUES (1, 5), (1, 6), (2, 5), (2, 6), (3, 2); # Define service types INSERT INTO service_types (name, external) VALUES ("ping", 0), ("http", 0); # Bind service types to hostgroups, INSERT INTO services (hostgroup, service_type, external) VALUES (1, 1, 0), (2, 1, 0), (2, 2, 0), (1, 2, 0); # Our three alert_periods, two of which is assigned to the service_types 'ping' # and 'http' as the default period on any hostgroup:service pairs of that type, the # other is directly assigned to the testgroup-2-with-overrides:ping pair, # and thus overrides the defaults. INSERT INTO alert_period (name, parent_table, service_type, service, external) VALUES ("normal", "service_types", 1, NULL, 0), ("daylight", "service", NULL, 2, 0), ("normal", "service_types", 2, NULL, 0); # Define all the subperiods we'll be using in the config file. INSERT INTO subperiods (alert_period, weekday_start, weekday_end, time_start, time_end, month_start, month_end, monthday_start, monthday_end, monthweek_start, monthweek_end, external) VALUES (1, 1, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0), (2, 2, 6, "09:00", "17:00", NULL, NULL, NULL, NULL, NULL, NULL, 0), (3, 1, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0); # Depencey information. Here we'll make testgroup2:http depend # on testgroup2:fping and testgroup1:fping INSERT INTO dependency_tree (oper, left_type, left_dep_link, left_service_link, right_type, right_dep_link, right_service_link, external) VALUES ("AND", "LEAF", NULL, 1, "LEAF", NULL, 2, 0), ("AND", "TREE", 1, NULL, "LEAF", NULL, 4, 0); UPDATE services SET dependency_tree=2 WHERE id=3; # Here we get to the real heart of the database. Most of the actual data is # attributes on the various other tables. I've broken these up into some # groups for clarity INSERT INTO attributes (attribute_type, action, string, number, time, boolean, server, service, alert_period, service_type, period, host) VALUES #First some globals for server 1 (7, NULL, NULL, NULL, 300, NULL, 1, NULL, NULL, NULL, NULL, NULL), (8, NULL, "/home/mon", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (9, NULL, "alert.d", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (10, NULL, "mon.d", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (11, NULL, "state.d", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (12, NULL, "log.d", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (13, NULL, "dtlog", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (14, NULL, "history", NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (15, NULL, NULL, 1000, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL), (16, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL), #Globals for server 2 (7, NULL, NULL, NULL, 300, NULL, 2, NULL, NULL, NULL, NULL, NULL), (8, NULL, "/home/mon", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (9, NULL, "alert.d", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (10, NULL, "mon.d", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (11, NULL, "state.d", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (12, NULL, "log.d", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (13, NULL, "dtlog", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (14, NULL, "history", NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (15, NULL, NULL, 1000, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL), (16, NULL, NULL, NULL, NULL, 1, 2, NULL, NULL, NULL, NULL, NULL), #Default attributes for the ping service (1, NULL, NULL, NULL, 300, NULL, 1, NULL, NULL, 1, NULL, NULL), #interval (2, 3, NULL, NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL), #monitoraction #Attributes for the default period of the ping service (3, NULL, NULL, NULL, 2400, NULL, 2, NULL, 1, NULL, NULL, NULL),#alertevery (4, NULL, NULL, 3, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL),#alertafter (5, 1, "", NULL, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL),#alertaction (5, 2, "", NULL, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL),#alertaction (6, 1, "", NULL, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL),#upalertaction (6, 2, "", NULL, NULL, NULL, 2, NULL, 1, NULL, NULL, NULL),#upalertaction #Default attributes for the http service (1, NULL, NULL, NULL, 300, NULL, 1, NULL, NULL, 2, NULL, NULL), #interval (2, 4, NULL, NULL, NULL, NULL, 1, NULL, NULL, 2, NULL, NULL), #monitor #Attributes for the default period of the http service (3, NULL, NULL, NULL, 2400, NULL, 2, NULL, 3, NULL, NULL, NULL),#alertevery (4, NULL, NULL, 3, NULL, NULL, 2, NULL, 3, NULL, NULL, NULL),#alertafter (5, 1, "", NULL, NULL, NULL, 2, NULL, 3, NULL, NULL, NULL),#alertaction (5, 2, "", NULL, NULL, NULL, 2, NULL, 3, NULL, NULL, NULL),#alertaction (6, 1, "", NULL, NULL, NULL, 2, NULL, 3, NULL, NULL, NULL),#upalertaction (6, 2, "", NULL, NULL, NULL, 2, NULL, 3, NULL, NULL, NULL),#upalertaction #Attributes for the override on testgroup-2:ping (1, NULL, NULL, NULL, 240, NULL, 1, 2, NULL, NULL, NULL, NULL),# interval #Attributes for the override period on testgroup-2:ping (3, NULL, NULL, NULL, 1800, NULL, 2, NULL, 2, NULL, NULL, NULL),#alertevery (4, NULL, NULL, 4, NULL, NULL, 2, NULL, 2, NULL, NULL, NULL),#alertafter (5, 1, "", NULL, NULL, NULL, 2, NULL, 2, NULL, NULL, NULL),#alertaction (5, 2, "", NULL, NULL, NULL, 2, NULL, 2, NULL, NULL, NULL),#alertaction (6, 1, "", NULL, NULL, NULL, 2, NULL, 2, NULL, NULL, NULL),#upalertaction (6, 2, "", NULL, NULL, NULL, 2, NULL, 2, NULL, NULL, NULL),#upalertaction #Attributes for the override on testgroup-2:http (17, NULL, "-u /cgi-bin/testurl.pl", NULL, NULL, NULL, 1, 3, NULL, NULL, NULL, NULL);#monitorarguments