I would like to website to show information about host

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

I would like to website to show information about host

Postby rumarcin11 » Tue Jun 06, 2017 10:12 am

I would like to website to show information about host computer ie ip and mac address, of course I have the address of computer name
rumarcin11
 
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: I would like to website to show information about host

Postby mcapra » Tue Jun 06, 2017 11:07 am

If you can post a screenshot of where you want the information displayed, that might be helpful.

Notes are a pretty easy way to store such references:
Code: Select all
define host{
...
      notes               hello world
...
        }



The end result:

2017_06_06_11_04_23_Nagios_Core_on_10.35.6.51.png


If you wanted it somewhere else, you'd likely need to modify the CGIs or submit a feature request via the github. Here's some C I hacked together to get some Kibana/Marvel graphs to show for hosts in multiple spots:
https://pastebin.com/HERbhf6X

Which uses the following custom attributes for a given host:
Code: Select all
define host{
...
      _marvel_node_ip         10.26.100.21
      _marvel_node_name      esdev01
...
        }


It exists in multiple places in status.c; I just highlighted once instance. Incredibly inelegant, but worked as a proof of concept for my use case.
Attachments
2017_06_06_10_58_57_Nagios_Core_on_10.35.6.51.png
Former Nagios employee
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3587
Joined: Thu May 05, 2016 3:54 pm

Re: I would like to website to show information about host

Postby avandemore » Tue Jun 06, 2017 2:13 pm

@mcapra, cool solution! @rumarcin11 does that answer your question?
Previous Nagios employee
avandemore
 
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: I would like to website to show information about host

Postby rumarcin11 » Wed Jun 07, 2017 1:24 am

No. I mean I would like the www to show ip info and physical mac address

define host{
use host-pc
host_name eendlo
alias 2.05
address 13835_CEZ
hostgroups pc
parents BA-PD2
notes (PD2-2/16)
# contact_gruops admins
}
rumarcin11
 
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: I would like to website to show information about host

Postby lmiltchev » Wed Jun 07, 2017 10:36 am

No. I mean I would like the www to show ip info and physical mac address

Nagios does show you this info... Am I missing something? See below:

Code: Select all
define host{
use linux-server
host_name test
alias My test host
address 192.168.4.41
hostgroups linux-servers
parents localhost
notes (Test Linux VM - MAC Address: 00:0c:29:6d:bf:b0)
}


example01.PNG
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: I would like to website to show information about host

Postby rumarcin11 » Thu Jun 08, 2017 1:45 am

I have several computers and ips are automatically, so it needs to www to show me the ip of the computer because I set in the "address" configuration as the computer name, not ip after. Because it will not be this computer all the time he had the same ip
rumarcin11
 
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: I would like to website to show information about host

Postby rumarcin11 » Thu Jun 08, 2017 1:47 am

In place of service ping, to still show ip and not just status "OK"
rumarcin11
 
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: I would like to website to show information about host

Postby lmiltchev » Thu Jun 08, 2017 11:00 am

Maybe instead of ping, you could use check_dns. You should be able to see the ip in the output.

Example:

command definition
Code: Select all
define command {
       command_name                             check_dns
       command_line                             $USER1$/check_dns -H $HOSTADDRESS$ $ARG1$
}


host definition (google public dns)
Code: Select all
define host{
use linux-server
host_name test
alias My test host
address google-public-dns-a.google.com
hostgroups linux-servers
parents localhost
notes (Test Linux VM - MAC Address: xx:xx:xx:xx:xx:xx)
}


service definition
Code: Select all
define service {
host_name test
use generic-service
service_description Check DNS
check_command check_dns
}


in the GUI
example01.PNG


The ip address (8.8.8.8) is shown in the GUI. When I change the address of my test host from "google-public-dns-a.google.com" to "mpr.org", I see the updated ip address.

host definition (Minnesota Public Radio)
Code: Select all
define host{
use linux-server
host_name test
alias My test host
address mpr.org
hostgroups linux-servers
parents localhost
notes (Test Linux VM - MAC Address: xx:xx:xx:xx:xx:xx)
}


in the GUI
example02.PNG
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: I would like to website to show information about host

Postby rumarcin11 » Fri Jun 09, 2017 6:01 am

Thank you very much. I would like to know how it looks with mac, i mean i need a notes?
rumarcin11
 
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: I would like to website to show information about host

Postby lmiltchev » Fri Jun 09, 2017 11:36 am

I already showed you how the MAC will be displayed on the host.

example01.PNG


You could add the "notes" directive to the service too (if you wish).

Example:
Code: Select all
define service {
host_name test
use generic-service
service_description Check DNS
check_command check_dns
notes (Test Linux VM - MAC Address: xx:xx:xx:xx:xx:xx)
}


Then, you will be able to see the MAC on the service as well.

example02.PNG
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Next

Return to Nagios Core

Who is online

Users browsing this forum: mja and 18 guests