Reverse DNS Disabled

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
brandon-verrette
Posts: 12
Joined: Mon Oct 21, 2019 1:28 pm

Reverse DNS Disabled

Post by brandon-verrette »

Hello,

Whenever exporting the list of unique Host to CSV, the column for host name all say <Reverse DNS disabled>.I cant seem to enable this feature and DNS is properly configured


Any help would be greatly appreciated !
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reverse DNS Disabled

Post by ssax »

If you go to Admin > Global Settings, can you switch it to yes, then save, then switch it to no, then save or are you saying that's not working?

What OS/version are you using?

Please PM me a copy of your profile, you can download it from Admin > System Status by clicking the Download System Profile button.
brandon-verrette
Posts: 12
Joined: Mon Oct 21, 2019 1:28 pm

Re: Reverse DNS Disabled

Post by brandon-verrette »

If I change it to yes or no under "Disable Reverse DNS", the exported CSV still says "Reverse DNS Disabled "

Were currently running 2.1.6 and profile has been sent over

Thank you
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reverse DNS Disabled

Post by ssax »

If you grab one of the IP addresses and then run this command from the CLI, what does it output:

Code: Select all

nslookup X.X.X.X
brandon-verrette
Posts: 12
Joined: Mon Oct 21, 2019 1:28 pm

Re: Reverse DNS Disabled

Post by brandon-verrette »

So when I first tried it, I had to install bind-utils to have nslookup

Now when I do nslookup X.X.X.X, It responds with the correct hostname. However, the exported CSV of unique host still says <Reverse DNS disabled>

Ive even tried switching it to yes, then switching it back to no under global config.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reverse DNS Disabled

Post by ssax »

I'm able to reproduce this now, it's a bug.

First, make sure Disable Reverse DNS is set back to yes.

Then edit this file:

Code: Select all

/var/www/html/nagioslogserver/application/controllers/cli/CLI_Reporting.php
Change this code (around line 82):

Code: Select all

        foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host, true) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host, true) . ',' . 0 . ',' . $time . ",\n";
        }
To this:

Code: Select all

        foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 0 . ',' . $time . ",\n";
        }
Does that resolve it for you?
brandon-verrette
Posts: 12
Joined: Mon Oct 21, 2019 1:28 pm

Re: Reverse DNS Disabled

Post by brandon-verrette »

Unfortunately, that did not work for me. When I made the following changes, the CSV no longer has any value in the Hostname field.

Code: Select all

       foreach ($sending as $host => $logs) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 1 . ",," . $logs . "\n";
        }

        foreach ($not_sending as $host => $time) {
            $ret .= $host . ',' . dns_reverse_lookup($host) . ',' . 0 . ',' . $time . ",\n";
        }
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reverse DNS Disabled

Post by ssax »

It would be blank for ones that it's unable to get the DNS entries for. It's not showing for any of them?

If you grab the IP address from one of the hosts not listing anything in the CSV and run this command it returns everything properly?
nslookup X.X.X.X
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Reverse DNS Disabled

Post by cdienger »

Looks like a bug but probably different than the one we previously thought. I was able to reproduce it and it seems like once the option to disable DNS is enabled it properly disable it. You can disable it by running this from the command line:

Code: Select all

curl -XDELETE http://localhost:9200/nagioslogserver/cf_option/disable_reverse_dns
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
brandon-verrette
Posts: 12
Joined: Mon Oct 21, 2019 1:28 pm

Re: Reverse DNS Disabled

Post by brandon-verrette »

Enabling the Disable DNS followed by the delete command seemed to have worked.

Code: Select all

curl -XDELETE http://localhost:9200/nagioslogserver/cf_option/disable_reverse_dns
Thank you !
Locked