Ask Your Question

How can I retrieve facts from another server?

asked 2016-06-28 04:10:44 -0600

rory gravatar image

I have a manifest which installs the Zabbix agent, it looks like this:

class project::zabbix::agent {
    class { 'zabbix::agent':
        server => '',

I need to get the actual IP address of my Zabbix server, and put it in place of the ''.

On my Zabbix server I can see the IP is in networking=>ip when I run "facter", but I don't know how to access this data from other nodes.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-28 19:44:42 -0600

lupin gravatar image

You can create a custom fact of your Zabbix server IP address then use that on you class.

Custom Facts


Facter.add(:zabbix_server) do
     hname = Facter.value(:hostname)
     if hname =~ "zabbix_server_hostname"
        zabbix_server_ip = Facter.value(:ipaddress)

Then use in your class.

class { 'zabbix::agent':
        server => $::zabbix_server
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-06-28 04:10:44 -0600

Seen: 42 times

Last updated: Jun 28 '16