Hi all,
I'm using Zabbix 1.6.5 with Oracle DB on RHEL 4.
I have problem with IT services. When the downtime is set on service item, the SLA is not counted, but the parent services in the tree are still red and SLA going down. So I have to define the same downtime for each service in the tree. But this setup is conflicting with other services. Have someone else noticed this behaviour?
I made little workaround (Oracle DB only), maybe someone can review and improve:
In host.c I've added new function, which is checking whether the downtime is set
and in host.c I've modified function DBupdate_services
this will disable the update of parent services, if the service is in downtime window.
In Oracle is necessary to add function for unix timestamp convert, found at www.lifeaftercoffee.com
The above code is somehow working, BUT:
1] PHP frontend is not modified, so when service is in downtime period and triggers is ON and change via web frontend is made, it will update the parent services or could cause mess in the DB.
2] when trigger is ON and service is entering downtime, there is no change on the parent services. I need to periodically check the active triggers. I have found that some triggers updates are coded into timer.c, but I haven't seen C for very long time ..
I'm using Zabbix 1.6.5 with Oracle DB on RHEL 4.
I have problem with IT services. When the downtime is set on service item, the SLA is not counted, but the parent services in the tree are still red and SLA going down. So I have to define the same downtime for each service in the tree. But this setup is conflicting with other services. Have someone else noticed this behaviour?
I made little workaround (Oracle DB only), maybe someone can review and improve:
In host.c I've added new function, which is checking whether the downtime is set
Code:
int DBis_service_in_downtime(zbx_uint64_t serviceid)
{
DB_RESULT result;
DB_ROW row;
//Oracle DB
result = DBselect("SELECT 1 \
FROM services_times \
where 1=1 \
and to_char(sysdate, 'dy hh24:mi:ss') between to_char(unixts_to_date(ts_from+7200),'dy hh24:mi:ss') and to_char(unixts_to_date(ts_to+7200),'dy hh24:mi:ss') \
and serviceid=" ZBX_FS_UI64, serviceid);
while (NULL != (row = DBfetch(result)))
{
return 1;
}
return 0;
}
Code:
line:
DBupdate_services_rec(serviceid);
replaced with:
if (DBis_service_in_downtime(serviceid) == 0)
{
DBupdate_services_rec(serviceid);
}
In Oracle is necessary to add function for unix timestamp convert, found at www.lifeaftercoffee.com
The above code is somehow working, BUT:
1] PHP frontend is not modified, so when service is in downtime period and triggers is ON and change via web frontend is made, it will update the parent services or could cause mess in the DB.
2] when trigger is ON and service is entering downtime, there is no change on the parent services. I need to periodically check the active triggers. I have found that some triggers updates are coded into timer.c, but I haven't seen C for very long time ..