# 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 simple mon setup. CONNECT netsage; # Hosts INSERT INTO hosts (host_name, ip_address, external) VALUES ('monserver1.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), ('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', 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, 4); # 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 monserver defined above to actually be a MON server INSERT INTO servers (name, host, description, server_type, external) VALUES ('MON Slave Server', 1, 'This server does the actual monitoring', 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), ("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); # 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, for this example just 'ping' INSERT INTO service_types (name, external) VALUES ("ping", 0); # Bind service types to hostgroups, INSERT INTO services (hostgroup, service_type, external) VALUES (1, 1, 0), (2, 1, 0); # For this example the only alert period is on the 'ping' service type # definition. See the complex example to see how the hostgroup/service pair # can override the default period on a service type with its own INSERT INTO alert_period (name, parent_table, service_type, service, external) VALUES ("normal", "service_types", 1, 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); # 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 #Default attributes for the ping service (1, NULL, NULL, NULL, 300, NULL, 1, NULL, NULL, 1, NULL, NULL), (2, 3, NULL, NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, NULL), #Attributes for the default period of the ping service (3, NULL, NULL, NULL, 2400, NULL, 1, NULL, 1, NULL, NULL, NULL), (4, NULL, NULL, 3, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL), (5, 1, "", NULL, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL), (5, 2, "root@localhost", NULL, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL), (6, 1, "", NULL, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL), (6, 2, "root@localhost", NULL, NULL, NULL, 1, NULL, 1, NULL, NULL, NULL);