Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nagios 2.x and MySQL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
paintcheck200
n00b
n00b


Joined: 22 Oct 2004
Posts: 47

PostPosted: Thu Jul 06, 2006 6:25 pm    Post subject: Nagios 2.x and MySQL Reply with quote

Here is a perl script I wrote to help pushes /var/nagios/services.dat to a SQL DB

It could use some work to bring down CPU ussage of MySQL - feel free to modify , but please post your improvements :wink:

Code:
#!/usr/bin/perl

#   Nagios 2.4 to MySql
#    Trevor    Newton - paintcheck200@gmail.com
#   Newtontek
#   


#SQL STUFF
use DBI;
use Time::Local;

#CHANGE
$user     = "username";
$password = "password";
$database = "dbname";
$hostname = "localhost";
$port     = "3306";
$dsn      = "DBI:mysql:database=$database;host=$hostname;port=$port";

$dbh = DBI->connect($dsn, $user, $password);

#FILE to read from 
#CHANGE
$currenttime = time();

$filename = "/var/nagios/status.dat";
   
open( FILE, "< $filename" ) or die "Can't open $filename : $!";
   $item = "";
   foreach $line (<FILE>) {
       chomp($line);

      @lineitem = split(/=/, $line);
      $des = $lineitem[0];
      $value = $lineitem[1];
      
      #check for beginning service 
      if($line =~ m/service {/){
         #print "Service\n";
         $item = "service";                     
         $end = 0;      
      }elsif($line =~ m/host {/){
         #print "Host\n";
         $item = "host";
         $end = 0;
         
      }elsif($line =~ m/}/){
         #print "end\n";
         $hostname = "";
         $end = 1;
      }
      
         
      #Get All Values
      if($item eq "service"){
         #print $item."\n";
         #print $end."\n";
         if($des =~ m/host_name/){
                  $host_name=$value;
         }elsif($des =~ m/service_description/){
                  $service_description=$value;   
         }elsif($des =~ m/check_command/){
                  $check_command=$value;
         }elsif($des =~ m/modified_attributes/){
                  $modified_attributes=$value;
         }elsif($des =~ m/event_handler/){
                  $event_handler=$value;
         }elsif($des =~ m/has_been_checked/){
                  $has_been_checked=$value;
         }elsif($des =~ m/should_be_scheduled/){
                  $should_be_scheduled=$value;
         }elsif($des =~ m/check_execution_time/){
                  $check_execution_time=$value;
         }elsif($des =~ m/check_latency/){
                  $check_latency=$value;
         }elsif($des =~ m/check_type/){
                  $check_type=$value;
         }elsif($des =~ m/current_state/){
                  $current_state=$value;
         }elsif($des =~ m/last_hard_state/){
                  $last_hard_state=$value;
         }elsif($des =~ m/current_attempt/){
                  $current_attempt=$value;
         }elsif($des =~ m/max_attempts/){
                  $max_attempts=$value;
         }elsif($des =~ m/state_type/){
                  $state_type=$value;
         }elsif($des =~ m/last_state_change/){
                  $last_state_change=$value;
         }elsif($des =~ m/last_hard_state_change/){
                  $last_hard_state_change=$value;
         }elsif($des =~ m/last_time_ok/){
                  $last_time_ok=$value;
         }elsif($des =~ m/last_time_warning/){
                  $last_time_warning = $value;
         }elsif($des =~ m/last_time_unknown/){
                  $last_time_unknown = $value;
         }elsif($des =~ m/last_time_critical/){
                  $last_time_critical = $value;
         }elsif($des =~ m/plugin_output/){
                  $last_time_unknown = $value;
         }elsif($des =~ m/plugin_output/){
                  $plugin_output = $value;
         }elsif($des =~ m/performance_data/){
                  $performance_data = $value;
         }elsif($des =~ m/last_check/){
                  $last_check = $value;
         }elsif($des =~ m/next_check/){
                  $next_check = $value;
         }elsif($des =~ m/current_notification_number/){
                  $current_notification_number = $value;
         }elsif($des =~ m/last_notification/){
                  $last_notification = $value;
         }elsif($des =~ m/next_notification/){
                  $next_notification = $value;
         }elsif($des =~ m/no_more_notifications/){
                  $no_more_notifications = $value;
         }elsif($des =~ m/notifications_enabled/){
                  $notifications_enabled = $value;
         }elsif($des =~ m/active_checks_enabled/){
                  $active_checks_enabled = $value;
         }elsif($des =~ m/passive_checks_enabled/){
                  $passive_checks_enabled = $value;
         }elsif($des =~ m/event_handler_enabled/){
                  $event_handler_enabled = $value;
         }elsif($des =~ m/problem_has_been_acknowledged/){
                  $problem_has_been_acknowledged = $value;
         }elsif($des =~ m/acknowledgement_type/){
                  $acknowledgement_type = $value;
         }elsif($des =~ m/flap_detection_enabled/){
                  $flap_detection_enabled = $value;
         }elsif($des =~ m/failure_prediction_enabled/){
                  $failure_prediction_enabled = $value;
         }elsif($des =~ m/process_performance_data/){
                  $process_performance_data = $value;
         }elsif($des =~ m/obsess_over_service/){
                  $obsess_over_service = $value;
         }elsif($des =~ m/last_update/){
                  $last_update = $value;
         }elsif($des =~ m/is_flapping/){
                  $is_flapping = $value;
         }elsif($des =~ m/percent_state_change/){
                  $percent_state_change = $value;
         }elsif($des =~ m/scheduled_downtime_depth/){
                  $scheduled_downtime_depth = $value;
         }
         
         #check for existing
         $sth = $dbh->prepare("SELECT host_name,last_check FROM servicestatus WHERE host_name = \"".$host_name."\" AND service_description = \"".$service_description."\"");
         $sth->execute();
         while ( @columns = $sth->fetchrow ){

                                $dblast = $columns[1];
                                #print "DB_Time:".$dblast.l"\n";
                                #print "Last_Time:".$last_check."\n";

         }

         
         if(!$sth->rows && $end == 1){
               #IF Record doesn't exist, create it   
               #print "Does not exist\n";               
               $sth = $dbh->prepare("INSERT INTO servicestatus VALUES ('".$host_name."', '".$service_description."', '".$modified_attributes."', '".$check_command."', '".$event_handler."', '".$has_been_checked."', '".$should_be_scheduled."', '".$check_execution_time."', '".$check_latency."', '".$check_type."', '".$current_state."', '".$last_hard_state."', '".$current_attempt."', '".$max_attempts."', '".$state_type."', '".$last_state_change."', '".$last_hard_state_change."', '".$last_time_ok."', '".$last_time_warning."', '".$last_time_unknown."', '".$last_time_critical."', '".$plugin_output."', '".$performance_data."', '".$last_check."', '".$next_check."', '".$current_notification_number."', '".$last_notification."', '".$next_notification."', '".$no_more_notifications."', '".$notifications_enabled."', '".$active_checks_enabled."', '".$passive_checks_enabled."', '".$event_handler_enabled."', '".$problem_has_been_acknowledged."', '".$acknowledgement_type."', '".$flap_detection_enabled."', '".$failure_prediction_enabled."', '".$process_performance_data."', '".$obsess_over_service."', '".$last_update."', '".$is_flapping."', '".$percent_state_change."', '".$scheduled_downtime_dept."')");
               $sth->execute;
               $end = 0;                           
         }elsif($sth->rows && $end == 1  && $dblast < $last_check){
            #Update Record
            #print "Does exist\n";
            $sth = $dbh->prepare("UPDATE servicestatus SET modified_attributes = '".$modified_attributes."', check_command = '".$check_command."', event_handler = '".$event_handler."', has_been_checked = '".$has_been_checked."', should_be_scheduled = '".$should_be_scheduled."', check_execution_time = '".$check_execution_time."', check_latency = '".$check_latency."', check_type = '".$check_type."', current_state = '".$current_state."', last_hard_state = '".$last_hard_state."', current_attempt = '".$current_attempt."', max_attempts = '".$max_attempts."', state_type = '".$state_type."', last_state_change = '".$last_state_change."', last_hard_state_change = '".$last_hard_state_change."', last_time_ok = '".$last_time_ok."', last_time_warning = '".$last_time_warning."', last_time_unknown = '".$last_time_unknown."', last_time_critical = '".$last_time_critical."', plugin_output = '".$plugin_output."', performance_data = '".$performance_data."', last_check = '".$last_check."', next_check = '".$next_check."', current_notification_number = '".$current_notification_number."', last_notification = '".$last_notification."', next_notification = '".$next_notification."', no_more_notifications = '".$no_more_notifications."', notifications_enabled = '".$notifications_enabled."', active_checks_enabled = '".$active_checks_enabled."', passive_checks_enabled = '".$passive_checks_enabled."', event_handler_enabled = '".$event_handler_enabled."', problem_has_been_acknowledged = '".$problem_has_been_acknowledged."', acknowledgement_type = '".$acknowledgement_type."', flap_detection_enabled = '".$flap_detection_enabled."', failure_prediction_enabled = '".$failure_prediction_enabled."', process_performance_data = '".$process_performance_data."', obsess_over_service = '".$obsess_over_service."', last_update = '".$last_update."', is_flapping = '".$is_flapping."', percent_state_change = '".$percent_state_change."', scheduled_downtime_depth = '".$scheduled_downtime_depth."' WHERE host_name = '".$host_name."' AND service_description = '".$service_description."'");             
            #print "UPDATE servicestatus SET modified_attributes = '".$modified_attributes."', check_command = '".$check_command."', event_handler = '".$event_handler."', has_been_checked = '".$has_been_checked."', should_be_scheduled = '".$should_be_scheduled."', check_execution_time = '".$check_execution_time."', check_latency = '".$check_latency."', check_type = '".$check_type."', current_state = '".$current_state."', last_hard_state = '".$last_hard_state."', current_attempt = '".$current_attempt."', max_attempts = '".$max_attempts."', state_type = '".$state_type."', last_state_change = '".$last_state_change."', last_hard_state_change = '".$last_hard_state_change."', last_time_ok = '".$last_time_ok."', last_time_warning = '".$last_time_warning."', last_time_unknown = '".$last_time_unknown."', last_time_critical = '".$last_time_critical."', plugin_output = '".$plugin_output."', performance_data = '".$performance_data."', next_check = '".$next_check."', current_notification_number = '".$current_notification_number."', last_notification = '".$last_notification."', next_notification = '".$next_notification."', no_more_notifications = '".$no_more_notifications."', notifications_enabled = '".$notifications_enabled."', active_checks_enabled = '".$active_checks_enabled."', passive_checks_enabled = '".$passive_checks_enabled."', event_handler_enabled = '".$event_handler_enabled."', problem_has_been_acknowledged = '".$problem_has_been_acknowledged."', acknowledgement_type = '".$acknowledgement_type."', flap_detection_enabled = '".$flap_detection_enabled."', failure_prediction_enabled = '".$failure_prediction_enabled."', process_performance_data = '".$process_performance_data."', obsess_over_service = '".$obsess_over_service."', last_update = '".$last_update."', is_flapping = '".$is_flapping."', percent_state_change = '".$percent_state_change."', scheduled_downtime_depth = '".$scheduled_downtime_depth."' WHERE host_name = '".$host_name."' AND service_description = '".$service_description."'\n\n";            
            $sth->execute;
            $end = 0;            
         }
         #End Service
      
      #begin Host      
      }elsif ($item eq "host"){
         
         #get values         
         if($des =~ m/host_name/){
                  $host_name=$value;
         }elsif($des =~ m/check_command/){
                  $check_command=$value;
         }elsif($des =~ m/modified_attributes/){
                  $modified_attributes=$value;
         }elsif($des =~ m/event_handler/){
                  $event_handler=$value;
         }elsif($des =~ m/has_been_checked/){
                  $has_been_checked=$value;
         }elsif($des =~ m/should_be_scheduled/){
                  $should_be_scheduled=$value;
         }elsif($des =~ m/check_execution_time/){
                  $check_execution_time=$value;
         }elsif($des =~ m/check_latency/){
                  $check_latency=$value;
         }elsif($des =~ m/check_type/){
                  $check_type=$value;
         }elsif($des =~ m/current_state/){
                  $current_state=$value;
         }elsif($des =~ m/last_hard_state/){
                  $last_hard_state=$value;
         }elsif($des =~ m/plugin_output/){
                  $plugin_output=$value;
         }elsif($des =~ m/performance_data/){
                  $performance_data=$value;
         }elsif($des =~ m/last_check/){
                  $last_check=$value;
         }elsif($des =~ m/next_check/){
                  $next_check=$value;
         }elsif($des =~ m/current_attempt/){
                  $current_attempt=$value;
         }elsif($des =~ m/max_attempts/){
                  $max_attempts=$value;
         }elsif($des =~ m/state_type/){
                  $state_type=$value;
         }elsif($des =~ m/last_state_change/){
                  $last_state_change=$value;
         }elsif($des =~ m/last_hard_state_change/){
                  $last_hard_state_change=$value;
         }elsif($des =~ m/last_time_up/){
                  $last_time_up=$value;
         }elsif($des =~ m/last_time_down/){
                  $last_time_down = $value;
         }elsif($des =~ m/last_time_unreachable/){
                  $last_time_unreachable = $value;
         }elsif($des =~ m/last_notification/){
                  $last_notification = $value;
         }elsif($des =~ m/next_notification/){
                  $next_notification = $value;
         }elsif($des =~ m/no_more_notifications/){
                  $no_more_notifications = $value;
         }elsif($des =~ m/current_notification_number/){
                  $current_notification_number = $value;
         }elsif($des =~ m/notifications_enabled/){
                  $notifications_enabled = $value;
         }elsif($des =~ m/problem_has_been_acknowledged/){
                  $problem_has_been_acknowledged = $value;
         }elsif($des =~ m/acknowledgement_type/){
                  $acknowledgement_type = $value;
         }elsif($des =~ m/active_checks_enabled/){
                  $active_checks_enabled = $value;
         }elsif($des =~ m/passive_checks_enabled/){
                  $passive_checks_enabled = $value;
         }elsif($des =~ m/     event_handler_enabled/){
                  $event_handler_enabled = $value;
         }elsif($des =~ m/flap_detection_enabled/){
                  $flap_detection_enabled = $value;
         }elsif($des =~ m/failure_prediction_enabled/){
                  $failure_prediction_enabled = $value;
         }elsif($des =~ m/process_performance_data/){
                  $process_performance_data = $value;
         }elsif($des =~ m/obsess_over_host/){
                  $obsess_over_host = $value;
         }elsif($des =~ m/last_update/){
                  $last_update = $value;
         }elsif($des =~ m/is_flapping/){
                  $is_flapping = $value;
         }elsif($des =~ m/percent_state_change/){
                  $percent_state_change = $value;
         }elsif($des =~ m/scheduled_downtime_depth/){
                  $scheduled_downtime_depth = $value;
         }
         
         #check for existing
         $sth = $dbh->prepare("SELECT host_name,last_check FROM hoststatus WHERE host_name = \"".$host_name."\"");
         $sth->execute();
         #Set last_check stored in db
         while ( @columns = $sth->fetchrow ){
            
            $dblast = $columns[1];

         }
         if(!$sth->rows && $end == 1){
               #IF Record doesn't exist, create it   
               #print "Does not exist\n";               
               $sth = $dbh->prepare("INSERT INTO hoststatus VALUES ('".$host_name."', '".$modified_attributes."', '".$check_command."', '".$event_handler."', '".$has_been_checked."', '".$should_be_scheduled."', '".$check_execution_time."', '".$check_latency."', '".$check_type."', '".$current_state."', '".$last_hard_state."', '".$plugin_output."', '".$performance_data."', '".$last_check."', '".$next_check."', '".$current_attempt."', '".$max_attempts."', '".$state_type."', '".$last_state_change."', '".$last_hard_state_change."', '".$last_time_up."', '".$last_time_down."', '".$last_time_unreachable."', '".$last_notification."', '".$next_notification."', '".$no_more_notifications."', '".$current_notification_number."', '".$notifications_enabled."', '".$problem_has_been_acknowledged."', '".$acknowledgement_type."', '".$active_checks_enabled."', '".$passive_checks_enabled."', '".$event_handler_enabled."', '".$flap_detection_enabled."', '".$failure_prediction_enabled."', '".$process_performance_data."', '".$obsess_over_host."', '".$last_update."', '".$is_flapping."', '".$percent_state_change."', '".$scheduled_downtime_depth."')");
               $sth->execute;
               $end = 0;                           
         }elsif($sth->rows && $end == 1  && $dblast < $last_check){
            #Update Record
            #print "Does exist\n";
            $sth = $dbh->prepare("UPDATE hoststatus SET modified_attributes = '".$modified_attributes."',  check_command = '".$check_command."', event_handler = '".$event_handler."', has_been_checked = '".$has_been_checked."', should_be_scheduled = '".$should_be_scheduled."', check_execution_time = '".$check_execution_time."', check_latency = '".$check_latency."', check_type = '".$check_type."', current_state = '".$current_state."', last_hard_state = '".$last_hard_state."', plugin_output = '".$plugin_output."', performance_data = '".$performance_data."', last_check = '".$last_check."', next_check = '".$next_check."', current_attempt = '".$current_attempt."', max_attempts = '".$max_attempts."', state_type = '".$state_type."', last_state_change = '".$last_state_change."', last_hard_state_change = '".$last_hard_state_change."', last_time_up = '".$last_time_up."', last_time_down = '".$last_time_down."', last_time_unreachable = '".$last_time_unreachable."', last_notification = '".$last_notification."', next_notification = '".$next_notification."', no_more_notifications = '".$no_more_notifications."', current_notification_number = '".$current_notification_number."', notifications_enabled = '".$notifications_enabled."', problem_has_been_acknowledged = '".$problem_has_been_acknowledged."', acknowledgement_type = '".$acknowledgement_type."', active_checks_enabled = '".$active_checks_enabled."', passive_checks_enabled = '".$passive_checks_enabled."', event_handler_enabled = '".$event_handler_enabled."', flap_detection_enabled = '".$flap_detection_enabled."', failure_prediction_enabled = '".$failure_prediction_enabled."', process_performance_data = '".$process_performance_data."', obsess_over_host = '".$obsess_over_host."', last_update = '".$last_update."', is_flapping = '".$is_flapping."', percent_state_change = '".$percent_state_change."', scheduled_downtime_depth = '".$scheduled_downtime_depth."' WHERE host_name = '".$host_name."'");             
            #print "UPDATE servicestatus SET modified_attributes = '".$modified_attributes."', check_command = '".$check_command."', event_handler = '".$event_handler."', has_been_checked = '".$has_been_checked."', should_be_scheduled = '".$should_be_scheduled."', check_execution_time = '".$check_execution_time."', check_latency = '".$check_latency."', check_type = '".$check_type."', current_state = '".$current_state."', last_hard_state = '".$last_hard_state."', current_attempt = '".$current_attempt."', max_attempts = '".$max_attempts."', state_type = '".$state_type."', last_state_change = '".$last_state_change."', last_hard_state_change = '".$last_hard_state_change."', last_time_ok = '".$last_time_ok."', last_time_warning = '".$last_time_warning."', last_time_unknown = '".$last_time_unknown."', last_time_critical = '".$last_time_critical."', plugin_output = '".$plugin_output."', performance_data = '".$performance_data."', next_check = '".$next_check."', current_notification_number = '".$current_notification_number."', last_notification = '".$last_notification."', next_notification = '".$next_notification."', no_more_notifications = '".$no_more_notifications."', notifications_enabled = '".$notifications_enabled."', active_checks_enabled = '".$active_checks_enabled."', passive_checks_enabled = '".$passive_checks_enabled."', event_handler_enabled = '".$event_handler_enabled."', problem_has_been_acknowledged = '".$problem_has_been_acknowledged."', acknowledgement_type = '".$acknowledgement_type."', flap_detection_enabled = '".$flap_detection_enabled."', failure_prediction_enabled = '".$failure_prediction_enabled."', process_performance_data = '".$process_performance_data."', obsess_over_service = '".$obsess_over_service."', last_update = '".$last_update."', is_flapping = '".$is_flapping."', percent_state_change = '".$percent_state_change."', scheduled_downtime_depth = '".$scheduled_downtime_depth."' WHERE host_name = '".$host_name."' AND service_description = '".$service_description."'\n\n";            
            $sth->execute;
            $end = 0;            
         }
         
         
         
      }
      #End Host
            
      
      
   }


Here is the DB

Code:

-- Host: localhost:3306
-- Generation Time: Jul 06, 2006 at 09:30 AM
-- Server version: 4.1.20
-- PHP Version: 5.1.4-pl0-gentoo
--
-- Database: `nagios`
--

-- --------------------------------------------------------

--
-- Table structure for table `hoststatus`
--

CREATE TABLE `hoststatus` (
  `host_name` varchar(60) NOT NULL default '',
  `modified_attributes` varchar(60) NOT NULL default '',
  `check_command` varchar(60) NOT NULL default '',
  `event_handler` varchar(60) NOT NULL default '',
  `has_been_checked` varchar(60) NOT NULL default '',
  `should_be_scheduled` varchar(60) NOT NULL default '',
  `check_execution_time` varchar(60) NOT NULL default '',
  `check_latency` varchar(60) NOT NULL default '',
  `check_type` varchar(60) NOT NULL default '',
  `current_state` varchar(60) NOT NULL default '',
  `last_hard_state` varchar(60) NOT NULL default '',
  `plugin_output` text NOT NULL,
  `performance_data` varchar(60) NOT NULL default '',
  `last_check` varchar(60) NOT NULL default '',
  `next_check` varchar(60) NOT NULL default '',
  `current_attempt` varchar(60) NOT NULL default '',
  `max_attempts` varchar(60) NOT NULL default '',
  `state_type` varchar(60) NOT NULL default '',
  `last_state_change` varchar(60) NOT NULL default '',
  `last_hard_state_change` varchar(60) NOT NULL default '',
  `last_time_up` varchar(60) NOT NULL default '',
  `last_time_down` varchar(60) NOT NULL default '',
  `last_time_unreachable` varchar(60) NOT NULL default '',
  `last_notification` varchar(60) NOT NULL default '',
  `next_notification` varchar(60) NOT NULL default '',
  `no_more_notifications` varchar(60) NOT NULL default '',
  `current_notification_number` varchar(60) NOT NULL default '',
  `notifications_enabled` varchar(60) NOT NULL default '',
  `problem_has_been_acknowledged` varchar(60) NOT NULL default '',
  `acknowledgement_type` varchar(60) NOT NULL default '',
  `active_checks_enabled` varchar(60) NOT NULL default '',
  `passive_checks_enabled` varchar(60) NOT NULL default '',
  `event_handler_enabled` varchar(60) NOT NULL default '',
  `flap_detection_enabled` varchar(60) NOT NULL default '',
  `failure_prediction_enabled` varchar(60) NOT NULL default '',
  `process_performance_data` varchar(60) NOT NULL default '',
  `obsess_over_host` varchar(60) NOT NULL default '',
  `last_update` varchar(60) NOT NULL default '',
  `is_flapping` varchar(60) NOT NULL default '',
  `percent_state_change` varchar(60) NOT NULL default '',
  `scheduled_downtime_depth` varchar(60) NOT NULL default '',
  PRIMARY KEY  (`host_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


--
-- Table structure for table `servicestatus`
--

CREATE TABLE `servicestatus` (
  `host_name` varchar(60) NOT NULL default '',
  `service_description` varchar(60) NOT NULL default '',
  `modified_attributes` varchar(60) NOT NULL default '',
  `check_command` varchar(60) NOT NULL default '',
  `event_handler` varchar(60) NOT NULL default '',
  `has_been_checked` varchar(60) NOT NULL default '',
  `should_be_scheduled` varchar(60) NOT NULL default '',
  `check_execution_time` varchar(60) NOT NULL default '',
  `check_latency` varchar(60) NOT NULL default '',
  `check_type` varchar(60) NOT NULL default '',
  `current_state` varchar(60) NOT NULL default '',
  `last_hard_state` varchar(60) NOT NULL default '',
  `current_attempt` varchar(60) NOT NULL default '',
  `max_attempts` varchar(60) NOT NULL default '',
  `state_type` varchar(60) NOT NULL default '',
  `last_state_change` varchar(60) NOT NULL default '',
  `last_hard_state_change` varchar(60) NOT NULL default '',
  `last_time_ok` varchar(60) NOT NULL default '',
  `last_time_warning` varchar(60) NOT NULL default '',
  `last_time_unknown` varchar(60) NOT NULL default '',
  `last_time_critical` varchar(60) NOT NULL default '',
  `plugin_output` varchar(250) NOT NULL default '',
  `performance_data` varchar(60) NOT NULL default '',
  `last_check` varchar(60) NOT NULL default '',
  `next_check` varchar(60) NOT NULL default '',
  `current_notification_number` varchar(60) NOT NULL default '',
  `last_notification` varchar(60) NOT NULL default '',
  `next_notification` varchar(60) NOT NULL default '',
  `no_more_notifications` varchar(60) NOT NULL default '',
  `notifications_enabled` varchar(60) NOT NULL default '',
  `active_checks_enabled` varchar(60) NOT NULL default '',
  `passive_checks_enabled` varchar(60) NOT NULL default '',
  `event_handler_enabled` varchar(60) NOT NULL default '',
  `problem_has_been_acknowledged` varchar(60) NOT NULL default '',
  `acknowledgement_type` varchar(60) NOT NULL default '',
  `flap_detection_enabled` varchar(60) NOT NULL default '',
  `failure_prediction_enabled` varchar(60) NOT NULL default '',
  `process_performance_data` varchar(60) NOT NULL default '',
  `obsess_over_service` varchar(60) NOT NULL default '',
  `last_update` varchar(60) NOT NULL default '',
  `is_flapping` varchar(60) NOT NULL default '',
  `percent_state_change` varchar(60) NOT NULL default '',
  `scheduled_downtime_depth` varchar(60) NOT NULL default '',
  KEY `host_name` (`host_name`),
  KEY `service_description` (`service_description`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


Edit: I've added spaces after the commas in your INSERT sql lines as they were breaking the pagelayout pretty badly. --Maedhros
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum