Skip to content

Instantly share code, notes, and snippets.

@aero
Created October 7, 2010 03:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aero/614511 to your computer and use it in GitHub Desktop.
diff -uNr /usr/local/nagios/lib.bak/Opsview/Keyword.pm /usr/local/nagios/lib/Opsview/Keyword.pm
--- /usr/local/nagios/lib.bak/Opsview/Keyword.pm 2010-09-27 12:06:20.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Keyword.pm 2010-10-07 10:52:12.000000000 +0900
@@ -26,6 +26,8 @@
__PACKAGE__->table("keywords");
+__PACKAGE__->utf8_columns( qw/description/ );
+
__PACKAGE__->columns( Primary => qw/id/ );
__PACKAGE__->columns( Essential => qw/name description enabled style/ );
diff -uNr /usr/local/nagios/lib.bak/Opsview/Schema/Contacts.pm /usr/local/nagios/lib/Opsview/Schema/Contacts.pm
--- /usr/local/nagios/lib.bak/Opsview/Schema/Contacts.pm 2010-09-27 12:06:44.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Schema/Contacts.pm 2010-10-07 11:59:42.000000000 +0900
@@ -51,6 +51,7 @@
"uncommitted",
{ data_type => "INT", default_value => 0, is_nullable => 0, size => 11 },
);
+__PACKAGE__->utf8_columns(qw/description/);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint( "name", ["name"] );
__PACKAGE__->belongs_to( "role", "Opsview::Schema::Roles", { id => "role" } );
diff -uNr /usr/local/nagios/lib.bak/Opsview/Schema/Keywords.pm /usr/local/nagios/lib/Opsview/Schema/Keywords.pm
--- /usr/local/nagios/lib.bak/Opsview/Schema/Keywords.pm 2010-09-27 12:06:55.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Schema/Keywords.pm 2010-10-07 12:06:44.000000000 +0900
@@ -33,6 +33,7 @@
"uncommitted",
{ data_type => "SMALLINT", default_value => 0, is_nullable => 0, size => 6 },
);
+__PACKAGE__->utf8_columns( qw/name description/ );
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint( "name", ["name"] );
__PACKAGE__->has_many( "keywordhostgroups", "Opsview::Schema::Keywordhostgroups", { "foreign.keywordid" => "self.id" }, );
diff -uNr /usr/local/nagios/lib.bak/Opsview/Schema/Servicechecks.pm /usr/local/nagios/lib/Opsview/Schema/Servicechecks.pm
--- /usr/local/nagios/lib.bak/Opsview/Schema/Servicechecks.pm 2010-09-27 12:07:06.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Schema/Servicechecks.pm 2010-10-07 11:51:24.000000000 +0900
@@ -5,7 +5,7 @@
use base qw/Opsview::DBIx::Class Opsview::ServiceBase/;
-__PACKAGE__->load_components(qw/+Opsview::DBIx::Class::Common Validation Core/);
+__PACKAGE__->load_components(qw/+Opsview::DBIx::Class::Common Validation UTF8Columns Core/);
__PACKAGE__->table("servicechecks");
__PACKAGE__->add_columns(
"id",
@@ -105,6 +105,7 @@
"disable_name_change",
{ data_type => "TINYINT", default_value => 0, is_nullable => 0, size => 4 },
);
+__PACKAGE__->utf8_columns(qw/description/);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint( "name", ["name"] );
__PACKAGE__->has_many( "hostservicechecks", "Opsview::Schema::Hostservicechecks", { "foreign.servicecheckid" => "self.id" }, { "join_type" => "inner" } );
diff -uNr /usr/local/nagios/lib.bak/Opsview/Servicecheck.pm /usr/local/nagios/lib/Opsview/Servicecheck.pm
--- /usr/local/nagios/lib.bak/Opsview/Servicecheck.pm 2010-09-27 12:07:10.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Servicecheck.pm 2010-10-07 10:52:53.000000000 +0900
@@ -29,6 +29,8 @@
__PACKAGE__->table("servicechecks");
+__PACKAGE__->utf8_columns(qw/description/);
+
__PACKAGE__->columns( Primary => qw/id/, );
# See Host.pm re: number of columns in Essential
diff -uNr /usr/local/nagios/lib.bak/Runtime/Downtime.pm /usr/local/nagios/lib/Runtime/Downtime.pm
--- /usr/local/nagios/lib.bak/Runtime/Downtime.pm 2010-09-27 12:05:54.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Downtime.pm 2010-10-07 10:53:40.000000000 +0900
@@ -28,6 +28,8 @@
__PACKAGE__->table("nagios_scheduleddowntime");
+__PACKAGE__->utf8_columns(qw/comment_data/);
+
__PACKAGE__->columns( Primary => qw/scheduleddowntime_id/ );
__PACKAGE__->columns(
Essential => qw/
diff -uNr /usr/local/nagios/lib.bak/Runtime/Hostdowntime.pm /usr/local/nagios/lib/Runtime/Hostdowntime.pm
--- /usr/local/nagios/lib.bak/Runtime/Hostdowntime.pm 2010-09-27 12:05:55.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Hostdowntime.pm 2010-10-07 10:53:59.000000000 +0900
@@ -28,6 +28,8 @@
__PACKAGE__->table("nagios_scheduleddowntime");
+__PACKAGE__->utf8_columns(qw/comment_data/);
+
__PACKAGE__->columns( Primary => qw/scheduleddowntime_id/ );
__PACKAGE__->columns(
Essential => qw/
diff -uNr /usr/local/nagios/lib.bak/Runtime/Schema/NagiosStatehistory.pm /usr/local/nagios/lib/Runtime/Schema/NagiosStatehistory.pm
--- /usr/local/nagios/lib.bak/Runtime/Schema/NagiosStatehistory.pm 2010-09-27 12:06:02.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Schema/NagiosStatehistory.pm 2010-10-07 10:55:43.000000000 +0900
@@ -26,6 +26,7 @@
use base 'DBIx::Class';
__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
+__PACKAGE__->load_components(qw/UTF8Columns InflateColumn::DateTime Core/);
__PACKAGE__->table("nagios_statehistory");
__PACKAGE__->add_columns(
"statehistory_id",
@@ -60,6 +61,7 @@
"output",
{ data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
);
+__PACKAGE__->utf8_columns(qw/output/);
__PACKAGE__->set_primary_key("statehistory_id");
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-07-16 21:25:16
diff -uNr /usr/local/nagios/lib.bak/Runtime/Searches.pm /usr/local/nagios/lib/Runtime/Searches.pm
--- /usr/local/nagios/lib.bak/Runtime/Searches.pm 2010-09-27 12:05:56.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Searches.pm 2010-10-07 11:19:41.000000000 +0900
@@ -457,6 +457,7 @@
"nagios_hoststatus.problem_has_been_acknowledged as host_acknowledged",
"(nagios_hoststatus.current_state != 0 and nagios_hoststatus.problem_has_been_acknowledged != 1 and nagios_hoststatus.scheduled_downtime_depth = 0) as host_unhandled",
"nagios_hoststatus.output as host_output",
+ "nagios_servicestatus.perfdata as service_perfdata", # We need perfdata.
"nagios_hoststatus.current_check_attempt as host_current_check_attempt",
"nagios_hoststatus.max_check_attempts as host_max_check_attempts",
"CONVERT_TZ(nagios_hoststatus.last_check, '+00:00', 'SYSTEM') as host_last_check",
@@ -734,7 +735,9 @@
}
}
$this_service->{comments} = $comments->{ $hash->{service_object_id} } if ( defined $comments->{ $hash->{service_object_id} } );
- $this_service->{output} = $hash->{service_output};
+ $this_service->{perfdata} = $hash->{service_perfdata}; # We need perfdata
+ use Encode qw/decode encode/;
+ $this_service->{output} = decode('utf8',$hash->{service_output});
$this_service->{unhandled} = $hash->{service_unhandled};
$this_service->{perfdata_available} = $hash->{perfdata_available};
$this_service->{markdown_filter} = $hash->{markdown_filter};
diff -uNr /usr/local/nagios/lib.bak/Runtime/Servicedowntime.pm /usr/local/nagios/lib/Runtime/Servicedowntime.pm
--- /usr/local/nagios/lib.bak/Runtime/Servicedowntime.pm 2010-09-27 12:05:57.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Servicedowntime.pm 2010-10-07 11:22:52.000000000 +0900
@@ -28,6 +28,8 @@
__PACKAGE__->table("nagios_scheduleddowntime");
+__PACKAGE__->utf8_columns(qw/comment_data/);
+
__PACKAGE__->columns( Primary => qw/scheduleddowntime_id/ );
__PACKAGE__->columns(
Essential => qw/
diff -uNr /usr/local/nagios/lib.bak/Runtime/Servicestatus.pm /usr/local/nagios/lib/Runtime/Servicestatus.pm
--- /usr/local/nagios/lib.bak/Runtime/Servicestatus.pm 2010-09-27 12:05:57.000000000 +0900
+++ /usr/local/nagios/lib/Runtime/Servicestatus.pm 2010-10-07 11:22:33.000000000 +0900
@@ -27,6 +27,8 @@
__PACKAGE__->table("nagios_servicestatus");
+__PACKAGE__->utf8_columns( qw/output/ );
+
__PACKAGE__->columns( Primary => qw/service_object_id/ );
__PACKAGE__->columns( Essential => qw/output last_check next_check current_state/ );
diff -uNr /usr/local/nagios/lib.bak/Runtime.pm /usr/local/nagios/lib/Runtime.pm
--- /usr/local/nagios/lib.bak/Runtime.pm 2010-09-27 12:05:41.000000000 +0900
+++ /usr/local/nagios/lib/Runtime.pm 2010-10-07 11:22:07.000000000 +0900
@@ -26,6 +26,7 @@
use Class::DBI::Sweet;
use base "Exporter", 'Class::DBI::Sweet', "Opsview::Base", "ClassDBIExtras";
use Opsview::Config;
+use Class::DBI::utf8 qw(-nosearch);
use Carp;
use Exporter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment