-- $Id: db-example.sql,v 1.1 2002/03/18 22:43:04 fpmip Exp $

-- Author : Tycho Fruru <tycho@fruru.com>
-- Copyright (C) 2001 Tycho Fruru <tycho@fruru.com>
-- Copyright (C) 2001 Conostix S.A. Luxembourg - Tycho Fruru <tycho@conostix.com>

-- This program is free software; you can redistribute it and/or modify it
-- under the terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 2 of the License, or (at your
-- option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-- for more details.

create table ipfc_schema
(
	component	text,
	version		text,
	id		text,
	date		timestamp default now()
);

insert into ipfc_schema (component,version,id) 
	values ('db-example',
		'20020204-01',
		'$Id: db-example.sql,v 1.1 2002/03/18 22:43:04 fpmip Exp $');

-- Now insert some values in the tables

insert into users (login_name,fullname,email) values ('ipfc','IPFC user','ipfc@conostix.com');
insert into users (login_name,fullname,email) values ('tycho','Tycho Fruru','tycho@fruru.com');
insert into users (login_name,fullname,email) values ('alex','Alexandre Dulaunoy','alex@foo.be');

insert into agent_types values ('snort','snort');
insert into agent_types values ('apache','apache');
insert into agent_types values ('chkp','Check Point Firewall-1');
insert into agent_types values ('syslog','syslog');
insert into agent_types values ('netfilter','Linux Netfilter firewall');
insert into agent_types values ('mon','mon alert ipfc.alert');

insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('apache','log','common-log','1','log-line','IPFC::Parse::Transport::LogLine','IPFC::Parse::Event::Apache');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('apache','log','combined-log','1','log-line','IPFC::Parse::Transport::LogLine','IPFC::Parse::Event::Apache');
-- common log with virtual host
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('apache','log','common-log-virtual','1','log-line','IPFC::Parse::Transport::LogLine','IPFC::Parse::Event::Apache');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('apache','log','error-log','1','log-line','IPFC::Parse::Transport::LogLine','IPFC::Parse::Event::ApacheErrorlog');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('syslog','status','availability','1','null','IPFC::Parse::Transport::Null','IPFC::Parse::Event::Availability');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('syslog','log','syslog','1','syslog-line','IPFC::Parse::Transport::SyslogLine','IPFC::Parse::Event::Syslog');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
	('syslog','log','syslog-line','1','syslog-line','IPFC::Parse::Transport::SyslogLine','IPFC::Parse::Event::Syslog');
--insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
--	('chkp','log','log-4.1','1','null','process_transport_null','process_chkp_log41_1');
--insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values 
--	('netfilter','log','netfilter-line','1','null','process_transport_null','process_netfilter_log_1');
insert into table_names (agent_type_name,entry_type,entry_subtype,entry_version,entry_transport,transport_function_name,function_name) values
	('mon','status','mon-alert','1','mon-alert','IPFC::Parse::Transport::MonAlert','IPFC::Parse::Event::MonAlert');
	
insert into agents values (1,'syslog','tournesol syslog','syslog daemon on tournesol');
insert into agents values (2,'apache','perycles apache','apache on perycles');
insert into agents values (3,'syslog','perycles syslog','syslog daemon on perycles');
insert into agents values (15,'syslog','brolix syslog','syslog daemon on brolix');
insert into agents values (17,'apache','tounesol apache','apache server on tournesol');
insert into agents values (1024,'chkp','kungfoo checkpoint','checkpoint firewall on kungfoo');
insert into agents values (1025,'netfilter','kungfoo netfilter','netfilter on kungfoo');
insert into agents values (1026,'mon','kungfoo mon','mon agent on kungfoo');

insert into agent_url_ids values (1,'tournesol-urls');
insert into agent_url_ids values (2,'perycles-urls');
insert into agent_url_ids values (3,'perycles-urls');
insert into agent_url_ids values (15,'brolix-urls');
insert into agent_url_ids values (17,'tournesol-urls');
insert into agent_url_ids values (1024,'kungfoo-urls');
insert into agent_url_ids values (1025,'kungfoo-urls');
insert into agent_url_ids values (1026,'kungfoo-urls');

insert into user_rights (login_name,agent_id,can_view) values
	('tycho','1','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','2','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','3','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','15','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','17','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','1024','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','1025','t');
insert into user_rights (login_name,agent_id,can_view) values
	('tycho','1026','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','1','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','2','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','3','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','15','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','17','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','1024','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','1025','t');
insert into user_rights (login_name,agent_id,can_view) values
	('ipfc','1026','t');
	
