No Viewports anymore after Upgrade

5 replies [Last post]
schultepaulus's picture
schultepaulus
User offline. Last seen 2 weeks 3 days ago. Offline
Opsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 10 Jun 2010
Posts:
Points: 347

Hello,

I upgraded Opsview to 3.7.2 - now I cannot see any configured Viewports anymore. The upgrade ran without errors on the console (I think this issue was after upgrading to 3.7.1). On the Mailinglist I found a hint from Duncs:
run:

/usr/local/nagios/bin/db_mysql
/usr/local/nagios/installer/upgradedb.pl

This didn't help, I still get this messages in opsviewd.log:

[2010/09/02 12:17:12] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_viewports_temporary' doesn't exist [for Statement "
INSERT INTO opsview_viewports_tmp

I noticed, that in the Keyword-Configuration Page the Amount of "Total Services" is 0. I tested this on a different system with working viewports with version 3.3.1 and upgraded to 3.7.2: After the upgrade all "Total Services" went to 0 :-/

Thanks a lot for help!

Mario

0
Your rating: None
tonvoon's picture
tonvoon
User offline. Last seen 5 days 7 hours ago. Offline
Opsview Sensei - 1st Dan
Joined: 26 May 2010
Posts:
Points: 65

What other errors are in the opsviewd.log related to ndoutils_configdumpend? This doesn't look right at all.

Your rating: None Average: 5 (1 vote)
schultepaulus's picture
schultepaulus
User offline. Last seen 2 weeks 3 days ago. Offline
Opsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 10 Jun 2010
Posts:
Points: 347

Hi Ton,

Sorry for the late reply, was on holidays.

This is the whole log while reloading:

<code>

[2010/09/22 17:33:19] [opsviewd] [INFO] Running 'web_reload' with args:
[2010/09/22 17:33:22] [create_and_send_configs] [INFO] Starting overall
[2010/09/22 17:33:37] [create_and_send_configs] [INFO] Ending overall with error=0
[2010/09/22 17:33:45] [ndoutils_configdumpend] [INFO] Start
[2010/09/22 17:33:45] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Can't create table '/tmp/#sql137a_2cbeb6_0' (errno: -1) [for Statement "CREATE TEMPORARY TABLE opsview_contact_services_temporary LIKE opsview_contact_services"]
[2010/09/22 17:33:45] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_contact_services_temporary' doesn't exist [for Statement "
INSERT INTO opsview_contact_services_temporary
SELECT c.id, s.service_object_id
FROM
opsview.contacts c,
nagios_objects o,
nagios_contactgroup_members cgm,
nagios_contactgroups cg,
nagios_service_contactgroups scg,
nagios_services s
WHERE
o.objecttype_id=10
AND binary c.username = o.name1
AND o.object_id = cgm.contact_object_id
AND cgm.contactgroup_id = cg.contactgroup_id
AND cg.contactgroup_object_id = scg.contactgroup_object_id
AND scg.service_id = s.service_id
AND s.config_type = 1
"]
[2010/09/22 17:33:45] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_contact_services_temporary' doesn't exist [for Statement "
INSERT INTO opsview_contact_services_tmp
SELECT DISTINCT contactid,service_object_id
FROM opsview_contact_services_temporary
"]
[2010/09/22 17:33:47] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Can't create table '/tmp/#sql137a_2cbeb6_2' (errno: -1) [for Statement "CREATE TEMPORARY TABLE opsview_viewports_temporary LIKE opsview_viewports"]
[2010/09/22 17:33:47] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_viewports_temporary' doesn't exist [for Statement "
INSERT INTO opsview_viewports_temporary
SELECT
kh.keywordid,
k.name,
ohs.hostname,
ohs.servicename,
ohs.host_object_id,
ohs.service_object_id
FROM
opsview.keywords as k,
opsview.keywordhosts as kh,
opsview.hosts as h,
opsview.keywordservicechecks as ksc,
opsview.servicechecks as sc,
runtime.opsview_host_services ohs
WHERE
ksc.keywordid = kh.keywordid
AND kh.hostid = h.id
AND ksc.servicecheckid = sc.id
AND ohs.hostname = h.name
AND (ohs.servicename = sc.name || ohs.servicename like concat(sc.name,': %') )
AND kh.keywordid = k.id
AND k.all_hosts = 0
AND k.all_servicechecks = 0
"]
[2010/09/22 17:33:47] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_viewports_temporary' doesn't exist [for Statement "
INSERT INTO opsview_viewports_temporary
SELECT
k.id,
k.name,
ohs.hostname,
ohs.servicename,
ohs.host_object_id,
ohs.service_object_id
FROM
opsview.keywords as k,
opsview.keywordhosts as kh,
opsview.hosts as h,
runtime.opsview_host_services ohs
WHERE
k.id = kh.keywordid
AND kh.hostid = h.id
AND ohs.hostname = h.name
AND k.all_servicechecks = 1
"]
[2010/09/22 17:33:47] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_viewports_temporary' doesn't exist [for Statement "
INSERT INTO opsview_viewports_temporary
SELECT
k.id,
k.name,
ohs.hostname,
ohs.servicename,
ohs.host_object_id,
ohs.service_object_id
FROM
opsview.keywords as k,
opsview.keywordservicechecks as ksc,
opsview.servicechecks as sc,
runtime.opsview_host_services ohs
WHERE
k.id = ksc.keywordid
AND ksc.servicecheckid = sc.id
AND (ohs.servicename = sc.name || ohs.servicename like concat(sc.name,': %') )
AND k.all_hosts = 1
"]
[2010/09/22 17:33:47] [ndoutils_configdumpend] [FATAL] DBD::mysql::db do failed: Table 'runtime.opsview_viewports_temporary' doesn't exist [for Statement "
INSERT INTO opsview_viewports_tmp
SELECT DISTINCT viewportid, keyword, hostname, servicename, host_object_id, service_object_id
FROM opsview_viewports_temporary
"]
[2010/09/22 17:33:52] [ndoutils_configdumpend] [INFO] End

</code>

Space on HDD is okay.

Thanks a lot for Help!

Mario

Your rating: None
tonvoon's picture
tonvoon
User offline. Last seen 5 days 7 hours ago. Offline
Opsview Sensei - 1st Dan
Joined: 26 May 2010
Posts:
Points: 65

Take a look at http://www.opsview.com/forum/opsview-community-edition/latest-release/pr... which has similar issues.

If it's the same, then I wonder if there's a pattern on why this is happening....

Your rating: None
schultepaulus's picture
schultepaulus
User offline. Last seen 2 weeks 3 days ago. Offline
Opsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 10 Jun 2010
Posts:
Points: 347

Thanks for the hint!

I've tested as described, I can create the tables manually without problems:

mysql> create table opsview_contact_services_temporary LIKE opsview_contact_services;
     Query OK, 0 rows affected (0.09 sec)

mysql> create table opsview_viewports_temporary like opsview_viewports;
     Query OK, 0 rows affected (0.41 sec)

I haven't any *.ibd files from tables which are dropped.

Thanks for help!

Your rating: None
schultepaulus's picture
schultepaulus
User offline. Last seen 2 weeks 3 days ago. Offline
Opsview Sensei - 4th DanOpsview Sensei - 3rd DanOpsview Sensei - 2nd DanOpsview Sensei - 1st Dan
Joined: 10 Jun 2010
Posts:
Points: 347

Obviously I solved the problem:

After adding this lines:

/usr/sbin/mysqld {

/tmp/ r,
/tmp/** rwk,
}

to 

/etc/apparmor.d/usr.sbin.mysqld

and rebooted the server, no errors occured!

Mario

Your rating: None