Unique Hosts Report shows logs from multiple systems

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
jeepers
Posts: 7
Joined: Wed Jul 19, 2017 2:12 pm

Unique Hosts Report shows logs from multiple systems

Post by jeepers »

Nagios Log Server 2.0.2
on CentOS 7

The new hosts.php report page is matching more than just the hostname of the system.

For example, from the unique hosts report I click on my server named test01.mydomain.com, and it shows me results for test02.mydomain.com and numerous other results along with test01.mydomain.com where .mydomain.com is highlighted in yellow in all the results. I essentially see a large majority of our servers in the query results, not a single unique server.

If I wrap my host name in quotes the query results show the correct and accurate host logs.

Is there a supported way I can correct this behavior that won’t get overridden by updates?
It looks like this section of code could do with out the conditional if clause and just have it always wrap the host in quotes in the elasticsearch query:

Code: Select all

foreach ($hosts as $host => $logs) {
                                $hostname = gethostbyaddr($host);
                                $display = $host;
                                if ($hostname != $host) {
                                    $display = $host . " (" . $hostname . ")";
                                }
                                $query = $host;
                                if (strpos($query, ':') !== false) { $query = '"' . $query . '"'; }

Works better like this:

Code: Select all

foreach ($hosts as $host => $logs) {
                                $hostname = gethostbyaddr($host);
                                $display = $host;
                                if ($hostname != $host) {
                                    $display = $host . " (" . $hostname . ")";
                                }
                                $query = $host;
                                $query = '"' . $query . '"';
Is there a supported method for customers to add their own reports? I want to ensure any fixes I attempt don't cause issues with our paid support contract.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Unique Hosts Report shows logs from multiple systems

Post by cdienger »

Hi @jeepers, can you provide a screenshot of the dashboard so we can see exactly what the query is and results? I'm discussing it with our dev team now and need some clarification.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jeepers
Posts: 7
Joined: Wed Jul 19, 2017 2:12 pm

Re: Unique Hosts Report shows logs from multiple systems

Post by jeepers »

See support ticket #516369
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Unique Hosts Report shows logs from multiple systems

Post by dwhitfield »

locking due to ticket
Locked