Feature Req:Contact Alias Home>Incident mgmt>Notifications
Posted: Thu Nov 19, 2020 2:54 am
Hello,
While ago I've requested feature to add aliases into notification sub page. Our company for contacts uses number based ids (authorized with AD) like mine plk068040 - I can remember mine - and several of my colegues - but we have like 200 contacts accross company...so...I've reuested alias inside notification -> http://nagiosurl/nagiosxi/reports/notifications.php Home Pages>Incident management sub section>Notifications
Since I did not received support I have found several hours of time yesterday and here is the solution:
Patch 4 Alias @ Notifications by Ludwik Warszawa (from PLK)
all changes are under /usr/local/nagiosxi
file: html/db/queries.inc.php
Line 928 Insert line -> obj4.alias AS contact_alias,
Line 942 Insert line -> LEFT JOIN " . $db_tables[DB_NDOUTILS]['contacts'] . " as obj4 ON " . $db_tables[DB_NDOUTILS]['contactnotifications'] . ".contact_object_id=obj4.contact_object_id
file:html/includes/utils-xmlreports.inc.php
Line 784 Insert line-> $output .= get_xml_db_field(2, $rs, 'contact_alias');
file:html/reports/notifications.php
Line 536 Insert line-> <th><?php echo _("Alias"); ?></th>
Line 560 Insert line-> $alias = str_replace(" "," ",strval($not->contact_alias));
Line 650 Insert line-> echo "<td>" . $alias . "</td>";
If needed exports into csv with aliases also modify/insert following lines
Line 1116 Insert line-> $alias = strval($not->contact_alias);
Line 1135 Replace line with -> echo $not->start_time . ",\"" . $host_name . "\",\"" . $service_description . "\",\"" . $reason_text . "\",\"" . $escalated . "\",\"" . $state . "\",\"" . $contact . "\",\"" . $alias . "\"," . $dispatcher . "," . $command . ",\"" . str_replace(''', "'", html_entity_decode($output)) . "\"\n"
Also I have attached ready made patches (remember to backup original files)
My patches software are distributed as such - I take no formall responsibility for any actions- and might be used however like.
- edited typos
While ago I've requested feature to add aliases into notification sub page. Our company for contacts uses number based ids (authorized with AD) like mine plk068040 - I can remember mine - and several of my colegues - but we have like 200 contacts accross company...so...I've reuested alias inside notification -> http://nagiosurl/nagiosxi/reports/notifications.php Home Pages>Incident management sub section>Notifications
Since I did not received support I have found several hours of time yesterday and here is the solution:
Patch 4 Alias @ Notifications by Ludwik Warszawa (from PLK)
all changes are under /usr/local/nagiosxi
file: html/db/queries.inc.php
Line 928 Insert line -> obj4.alias AS contact_alias,
Line 942 Insert line -> LEFT JOIN " . $db_tables[DB_NDOUTILS]['contacts'] . " as obj4 ON " . $db_tables[DB_NDOUTILS]['contactnotifications'] . ".contact_object_id=obj4.contact_object_id
file:html/includes/utils-xmlreports.inc.php
Line 784 Insert line-> $output .= get_xml_db_field(2, $rs, 'contact_alias');
file:html/reports/notifications.php
Line 536 Insert line-> <th><?php echo _("Alias"); ?></th>
Line 560 Insert line-> $alias = str_replace(" "," ",strval($not->contact_alias));
Line 650 Insert line-> echo "<td>" . $alias . "</td>";
If needed exports into csv with aliases also modify/insert following lines
Line 1116 Insert line-> $alias = strval($not->contact_alias);
Line 1135 Replace line with -> echo $not->start_time . ",\"" . $host_name . "\",\"" . $service_description . "\",\"" . $reason_text . "\",\"" . $escalated . "\",\"" . $state . "\",\"" . $contact . "\",\"" . $alias . "\"," . $dispatcher . "," . $command . ",\"" . str_replace(''', "'", html_entity_decode($output)) . "\"\n"
Also I have attached ready made patches (remember to backup original files)
My patches software are distributed as such - I take no formall responsibility for any actions- and might be used however like.
- edited typos