Host Lookup in hosts file..

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.
oslec
Posts: 53
Joined: Mon Jan 14, 2013 5:19 pm

Host Lookup in hosts file..

Post by oslec »

Hi
I need to resolve the name instead of IP address in reports...i have de Hosts file:

name 10.10.10.1
name2 10.10.10.2

but the reports always show me the IP addresss..

Can you help me...

Regards!
Sergio
oslec
Posts: 53
Joined: Mon Jan 14, 2013 5:19 pm

Re: Host Lookup in hosts file..

Post by oslec »

Searching a little bit..

I found this...

nfdump -r nfcapd.201403211340 | perl -i -p -e 'use Socket; s#(\d{1,3}(\.\d{1,3}){3})\b#gethostbyaddr(inet_aton($1), AF_INET) or sprintf($1)#egi'

And the output..

2014-03-21 13:46:22.870 2.000 ICMP ixtrtc22cmr:0 -> ixtrtc22lbg:0.0 3 252 1
2014-03-21 13:46:19.120 7.558 TCP ixtrtc22lbg:43023 -> ixtrtc22lbg:58335 36 61006 1
2014-03-21 13:46:19.119 7.559 TCP ixtrtc22lbg:54472 -> ixtrtc22lbg:38618 31 7481 1
2014-03-21 13:46:19.071 7.607 TCP ixtrtc22lbg:38618 -> ixtrtc22lbg:54469 17 23198 1

The IP resolvs the hostname correctly...

Where in the code implement the function in perl to resolv.. ? nfdump.py ?

Can you help me ?

Regards!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host Lookup in hosts file..

Post by abrist »

Have you defined the hosts by ip, or fqdn? The reports should use whatever you specified . . . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
oslec
Posts: 53
Joined: Mon Jan 14, 2013 5:19 pm

Re: Host Lookup in hosts file..

Post by oslec »

Hi,

For example...
Voila_Capture 2014-03-25_02-34-30_PM.png
I want to see the Source IP by Hostname ...because each server have 5 differents IPs...

Regards!
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host Lookup in hosts file..

Post by tmcdonald »

As abrist already asked:
abrist wrote:Have you defined the hosts by ip, or fqdn?
Former Nagios employee
oslec
Posts: 53
Joined: Mon Jan 14, 2013 5:19 pm

Re: Host Lookup in hosts file..

Post by oslec »

Hi,


If the report is made via hostname, already have the list of hosts in the hosts file, but the NA continues to show us IPs instead of names. In all reports by default, as in the graphs of Pie.

The reports are the default of the system, only instead of showing the fqdn, show ips. And we are looking at the whole system that we display the names.

The only place where we display the names is in the Dashboard and only when we point the cursor over the IP.

All the IPs are private ..and the file /etc/hosts already define the hostname by IP. I need a Internal DNS ?


Any tips?

Regards!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Host Lookup in hosts file..

Post by lmiltchev »

I believe the following function is used to determine the FQDN in Nagios NA:

http://us3.php.net/gethostbyaddr

If FQDN cannot be determined, the IP is used. It has to be a DNS issue...
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Host Lookup in hosts file..

Post by snapon_admin »

It was my understanding, and I could be wrong so if any techs/devs want to correct me feel free, that displaying FQDNs in the reports was not something that was possible yet. As far as I am aware this is something the devs plan on adding and are looking into/working on currently. There is actually a feature request for this (posted by me, in fact) already on tracker.nagios.com. You can display FQDNs on the main dashboard by hovering over the IPs as you said, but as for reports there is no way to do that currently that I am aware of.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Host Lookup in hosts file..

Post by lmiltchev »

@snapon_admin
Are you talking about this bug report? You are correct that this is not possible at the moment, however, as I remember, you were talking about pie-charts...
In any case, hovering over the IP under the "Reports" tab won't show the FQDN, while under the "Summary" tab it will (*should*).
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Host Lookup in hosts file..

Post by snapon_admin »

Yep, that was the one I was referring to, and yeah when I made that it was specifically for pie charts but I recall being told that this wasn't possible in the report at all, let alone the graphs. The screenshot that OP posted is from a report, so I assume he's trying to see FQDNs on hover in reports, which isn't possible as far as I'm aware. I also think an internal feature request was submitted for that functionality (which is why mine was just for the graphs), but I'm not positive on that.

It looks like OP is seeing FQDNs on the summary tab, since he mentioned it works in the Dashboard, which I take to assume means the Summary tab for a given source. the image in the reply quoted below looks like a report screen to me, which wouldn't show FQDNs on hover like the Summary tab does.
oslec wrote:Hi,

For example...

Screenshot snip

I want to see the Source IP by Hostname ...because each server have 5 differents IPs...

Regards!
Locked