Feature Req:Contact Alias Home>Incident mgmt>Notifications

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Ludwik.Warszawa
Posts: 5
Joined: Wed Apr 22, 2020 6:51 am

Feature Req:Contact Alias Home>Incident mgmt>Notifications

Post by Ludwik.Warszawa »

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('&apos;', "'", 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
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Feature Req:Contact Alias Home>Incident mgmt>Notificatio

Post by cdienger »

Thanks for the follow up and sharing what you came up with!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked