Mysql error in integrating nagios with cacti

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
chirag123
Posts: 2
Joined: Thu Oct 21, 2010 1:18 am

Mysql error in integrating nagios with cacti

Post by chirag123 »

somehow i fix the previous problem and make inserter.o file. now when i see cacti log files after clicking NPC tab in my cacti i got the following error :

10/22/2010 02:57:38 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select groupname, state, total, good_hosts, pending_hosts, bad_hosts, groupidfrom ( select coalesce(npc_hostgroup.alias,'[no group]') as groupname, coalesce(good.groupid,bad.groupid,pending.groupid) as groupid, coalesce(good.state,bad.state,pending.state) as state, coalesce(good.c,0) + coalesce(bad.c,0) + coalesce(pending.c,0) as total, coalesce(good.c,0) as good_hosts, coalesce(pending.c,0) as pending_hosts, coalesce(bad.c,0) as bad_hosts from npc_hostgroup, ( select count(*) as c, npc_service_history.soft_state as state, npc_hostgroup_membership.groupid as groupid from npc_service_history, npc_host_history, npc_service, npc_hostgroup_membership where npc_host_history.hostid = npc_hostgroup_membership.hostid and npc_host_history.lasted is null and npc_host_history.soft_state = 0 and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE group by state,groupid union select count(*) as c, npc_service_history.soft_state as state, 0 as groupid from npc_service_history, npc_host_history, npc_service where npc_host_history.hostid not in (select hostid from npc_hostgroup_membership) and npc_host_history.lasted is null and npc_host_history.soft_state = 0 and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE group by state-- begin crappy full join hack since mysql doesn't have them, add our other values union select 0 as c, -1 as state, npc_hostgroup_membership.groupid as groupid from npc_hostgroup_membership union select 0 as c, 1 as state, npc_hostgroup_membership.groupid as groupid from npc_hostgroup_membership union select 0 as c, 2 as state, npc_hostgroup_membership.groupid as groupid from npc_hostgroup_membership union select 0 as c, 3 as state, npc_hostgroup_membership.groupid as groupid from npc_hostgroup_membership ) good left join ( select count(*) as c, -1 as state, npc_hostgroup_membership.groupid as groupid from npc_service, npc_hostgroup_membership where npc_hostgroup_membership.hostid = npc_service.hostid and npc_service.has_been_checked = FALSE and npc_service.configured = TRUE group by groupid union select count(*) as c, -1 as state, 0 as groupid from npc_service where npc_service.hostid not in (select hostid from npc_hostgroup_membership) and npc_service.has_been_checked = FALSE and npc_service.configured = TRUE ) pending on ( pending.state = good.state and pending.groupid = good.groupid ) left join ( select count(*) as c, npc_service_history.soft_state as state, npc_hostgroup_membership.groupid as groupid from npc_service_history, npc_host_history, npc_service, npc_hostgroup_membership where npc_host_history.hostid = npc_hostgroup_membership.hostid and npc_host_history.lasted is null and npc_host_history.soft_state != 0 and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE group by state,groupid union select count(*) as c, npc_service_history.soft_state as state, 0 as groupid from npc_service_history, npc_host_history, npc_service where npc_host_history.hostid not in (select hostid from npc_hostgroup_membership) and npc_host_history.lasted is null and npc_host_history.soft_state != 0 and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE group by state ) bad on ( bad.state = good.state and bad.groupid = good.groupid ) where npc_hostgroup.id = coalesce(good.groupid,bad.groupid,pending.groupid) having total > 0 order by groupname, state) as tmp"
10/22/2010 02:57:38 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select groupname, soft_state, count, groupidfrom ( select npc_hostgroup.alias as groupname, npc_hostgroup.id as groupid, count(*) as count, soft_state as soft_state from npc_hostgroup, npc_hostgroup_membership, npc_host_history, npc_host_check, npc_host where npc_host.id = npc_host_check.hostid and npc_host.configured = TRUE and npc_hostgroup.id = npc_hostgroup_membership.groupid and npc_host_check.hostid = npc_hostgroup_membership.hostid and npc_host_history.hostid = npc_host_check.hostid and has_been_checked = TRUE and lasted is null group by soft_state,npc_hostgroup.alias,npc_hostgroup.id union select npc_hostgroup.alias as groupname, npc_hostgroup.id as groupid, count(*) as count, -1 as soft_state from npc_host_check, npc_host, npc_hostgroup, npc_hostgroup_membership where npc_host.id = npc_host_check.hostid and npc_host.configured = TRUE and npc_hostgroup.id = npc_hostgroup_membership.groupid and npc_host_check.hostid = npc_hostgroup_membership.hostid and has_been_checked = FALSE group by npc_hostgroup.alias,npc_hostgroup.id union select '[no group]' as groupname, 0 as groupid, count(*) as count, -1 as soft_state from npc_host, npc_host_check where npc_host.id = npc_host_check.hostid and npc_host.configured = TRUE and has_been_checked = FALSE and hostid not in (select hostid from npc_hostgroup_membership) union select '[no group]' as groupname, 0 as groupid, count(*) as count, soft_state as soft_state from npc_host, npc_host_history, npc_host_check where npc_host.id = npc_host_check.hostid and npc_host.configured = TRUE and npc_host_check.hostid not in (select hostid from npc_hostgroup_membership) and npc_host_history.hostid = npc_host_check.hostid and has_been_checked = TRUE and lasted is null group by soft_state ) as tmp"
10/22/2010 02:57:38 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select coalesce(good.state,bad.state,pending.state) as state, coalesce(good.c,0) + coalesce(bad.c,0) + coalesce(pending.c,0) as total, coalesce(good.c,0) as good_hosts, coalesce(pending.c,0) as pending_hosts, coalesce(bad.c,0) as bad_hostsfrom (-- begin crappy full join hack since mysql doesn't have them, add our other states by hand select tmp.c, tmp.state from ( select count(*) as c, npc_service_history.soft_state as state from npc_service_history, npc_host_history, npc_service, npc_host where npc_host_history.lasted is null and npc_host_history.soft_state = 0 and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE and npc_host_history.hostid = npc_host.id and npc_host.has_been_checked = TRUE group by state union select count(*) as c, -1 as state from npc_service, npc_host_history, npc_host where npc_host_history.hostid = npc_service.hostid and npc_host_history.lasted is null and npc_host_history.soft_state = 0 and npc_service.has_been_checked = FALSE and npc_service.configured = TRUE and npc_host_history.hostid = npc_host.id and npc_host.has_been_checked = TRUE-- force em in union select 0 as c, -1 as state union select 0 as c, 1 as state union select 0 as c, 2 as state union select 0 as c, 3 as state ) as tmp group by state ) good left join ( select count(*) as c, npc_service_history.soft_state as state from npc_service_history, npc_service, npc_host where npc_host.id = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE and npc_host.has_been_checked = FALSE group by state union select count(*) as c, -1 as state from npc_service, npc_host where npc_service.hostid = npc_host.id and npc_service.has_been_checked = FALSE and npc_service.configured = TRUE and npc_host.has_been_checked = FALSE ) pending on ( pending.state = good.state ) left join ( select count(*) as c, npc_service_history.soft_state as state from npc_service_history, npc_host_history, npc_service, npc_host where npc_host_history.lasted is null and npc_host_history.hostid = npc_service.hostid and npc_service_history.serviceid = npc_service.id and npc_service.has_been_checked = TRUE and npc_service_history.lasted is null and npc_service.configured = TRUE and npc_host_history.hostid = npc_host.id and npc_host.has_been_checked = TRUE and npc_host_history.soft_state != 0 group by state union select count(*) as c, -1 as state from npc_service, npc_host_history, npc_host where npc_host_history.hostid = npc_service.hostid and npc_host_history.lasted is null and npc_service.has_been_checked = FALSE and npc_service.configured = TRUE and npc_host_history.hostid = npc_host.id and npc_host_history.soft_state != 0 and npc_host.has_been_checked = TRUE ) bad on ( bad.state = good.state )"


can some one tell wat is the problem.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests