ZABBIX Forums  
  #1  
Old 03-02-2011, 15:35
agentguerry agentguerry is offline
Member
 
Join Date: Jul 2009
Posts: 45
Question Exporting list of Hostnames in Zabbix

Hi all,

I am trying to find the easiest way to export a list of all the hostnames in my zabbix database, either by the gui, or possibly in the mysql database.

Could anyone point me in the right direction for this?

I just want to pull the hostnames/servernames, and put them into an excel or even a txt document.

Thank you in advance,

agentguerry
Reply With Quote
  #2  
Old 03-02-2011, 17:39
trikke trikke is offline
Senior Member
 
Join Date: Aug 2007
Location: CH-Basel
Posts: 139
Default

easy one:

/opt/mysql/bin/mysql -u <user> -p <password> <db-name> "select name,dns,ip from hosts ;"

Lists the Zabbix Name, the DNS-name of this host and the IP of this host.

Greets
Patrick
Reply With Quote
  #3  
Old 03-02-2011, 19:06
nelsonab nelsonab is offline
Senior Member
Zabbix Certified Specialist
 
Join Date: Sep 2006
Location: Virginia
Posts: 1,205
Default

in zabcon:
get host


If you have more than 100 hosts you will need to up the limit for example
get host limit=200


If you want to do it from the command line

echo "get host limit=200" | zabcon.rb --no-echo --no-header
__________________
RHCE, Author of Zabcon, the Zabbix Cli Tool, and the Zabbix API Ruby Library Gem (zbxapi)
http://trac.red-tux.net

Unofficial Zabbix mirror and source code cross reference:
http://ztrac.red-tux.net

Reply With Quote
  #4  
Old 03-02-2011, 19:20
agentguerry agentguerry is offline
Member
 
Join Date: Jul 2009
Posts: 45
Default

Thanks Trikke!

Worked wonderfully!
Reply With Quote
Reply

Tags
export, hostname, mysql, zabbix 1.8.3

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:11.