Using Zabbix to monitor & deploy Salt

1,706 views
Skip to first unread message

Grant Ashman

unread,
Jun 14, 2013, 7:31:45 PM6/14/13
to salt-...@googlegroups.com
Hi all,

I've just started experimenting with Salt and so far I'm really enjoying it!
I'm looking to integrate Salt with my Zabbix platform and I'm wondering if anyone else has tried this yet?

There are two key things I'm looking to achieve;
  • Create Zabbix monitoring templates for both salt-master & salt-minion to check whether things are running and happy - this in itself should be pretty simple with some basic commands returning numbered results for things like "Is the salt-minion running on X?" Has anyone implemented any templates they'd be willing to share? I am trying to steer clear of Zabbix UserParameters and use the newer Remote Commands for easier administration going forward.
  • Secondly, I'm going to attempt to have Zabbix scrape each of my hosts to determine whether the Salt Minion is installed - I'm thinking that grepping /etc/init.d/ for salt-minion should be a fairly foolproof way of doing this. If the result returned is "0", then I'll have Zabbix execute an action to run the wget bootstrap script and silently install it on to my hosts. Again, has anyone implemented this, or similar? And if so, would you be willing to share your tales?
Right now, I'm testing on my own private network with ~12 hosts so the complexity is pretty low, however, we're discussing the idea of averaging Salt Stack at my company where we currently run well over ~900 hosts of different types (Including Windows Server - where my above example of scraping /etc/init.d/ would not work) and deploying Salt-minion across each host seems quiet daunting.

Thanks!
Grant

Romeo Theriault

unread,
Jun 15, 2013, 4:39:51 AM6/15/13
to salt-...@googlegroups.com
On Fri, Jun 14, 2013 at 1:31 PM, Grant Ashman <grant...@gmail.com> wrote:
Hi all,

I've just started experimenting with Salt and so far I'm really enjoying it!
I'm looking to integrate Salt with my Zabbix platform and I'm wondering if anyone else has tried this yet?

Hi Grant, I have not but I do have experience with zabbix.
 

There are two key things I'm looking to achieve;
  • Create Zabbix monitoring templates for both salt-master & salt-minion to check whether things are running and happy - this in itself should be pretty simple with some basic commands returning numbered results for things like "Is the salt-minion running on X?" Has anyone implemented any templates they'd be willing to share? I am trying to steer clear of Zabbix UserParameters and use the newer Remote Commands for easier administration going forward.
If you need to run remote commands then the new "remote commands" are easier to maintain in the long run. At least until you get your zabbix agents under configuration management, then updating the config files will be easy :)  But you should be able to do most of what you need with standard zabbix items like proc.num, etc....  I don't have to use remote commands very often, though they are very useful when you need them.

  • Secondly, I'm going to attempt to have Zabbix scrape each of my hosts to determine whether the Salt Minion is installed - I'm thinking that grepping /etc/init.d/ for salt-minion should be a fairly foolproof way of doing this.
I'd probably just use the built-in vfs.file.exists[file] item. It's likely to be lighter weight. Or even the system.sw.packages[<package>,<manager>,<format>] item.
 
  • If the result returned is "0", then I'll have Zabbix execute an action to run the wget bootstrap script and silently install it on to my hosts. Again, has anyone implemented this, or similar? And if so, would you be willing to share your tales?
I have not but you'll need to give the zabbix agent sudo privs to run the wget installer script which may be a bit of a catch-22 if you don't already have some sort of config management on the hosts already...(?)

For initial rollout anyway you may want to look to use a tool like ansible or fabric which can ssh (and sudo) into your boxes to run the installer if it's not already installed. Then, once you have salt installed you can verify everything with zabbix, alerting you when new hosts may not have gotten it installed. The next step of course is automating your host creation process :)

Cheers,
Romeo


 
Right now, I'm testing on my own private network with ~12 hosts so the complexity is pretty low, however, we're discussing the idea of averaging Salt Stack at my company where we currently run well over ~900 hosts of different types (Including Windows Server - where my above example of scraping /etc/init.d/ would not work) and deploying Salt-minion across each host seems quiet daunting.

Thanks!
Grant

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Romeo

Luminous Salt

unread,
Jun 15, 2013, 10:51:59 AM6/15/13
to salt-...@googlegroups.com
On 2013-06-15 04:39, Romeo Theriault wrote:
> On Fri, Jun 14, 2013 at 1:31 PM, Grant Ashman <grant...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I've just started experimenting with Salt and so far I'm really
>> enjoying it!
>> I'm looking to integrate Salt with my Zabbix platform and I'm
>> wondering if anyone else has tried this yet?
>
> Hi Grant, I have not but I do have experience with zabbix.
>  
>
>> There are two key things I'm looking to achieve;
>>
>> * Create Zabbix monitoring templates for both salt-master &
>> salt-minion to check whether things are running and happy - this in
>> itself should be pretty simple with some basic commands returning
>> numbered results for things like "Is the salt-minion running on X?"
>> Has anyone implemented any templates they'd be willing to share? I am
>> trying to steer clear of Zabbix UserParameters and use the newer
>> Remote Commands for easier administration going forward.
>
> If you need to run remote commands then the new "remote commands" are
> easier to maintain in the long run. At least until you get your zabbix
> agents under configuration management, then updating the config files
> will be easy :)  But you should be able to do most of what you need
> with standard zabbix items like proc.num, etc....  I don't have to use
> remote commands very often, though they are very useful when you need
> them.

while I have no direct experience running zabbix, my two cents:

Rather than using zabbix to deploy/run salt, I would instead manage
zabbix with salt, which (it sounds like) might result in simplying
zabbix's role within your environment.. so I would focus on getting
salt-minion deployed to all those systems and pointed at a master using
a tool like fabric, running over ssh.

This should actually be pretty simple. For situations like this, using
the salt-bootstrap script (retrieved with a simple wget and piped to sh,
as doc'd on github) and then an echo "ma.st.er.ip salt" >> /etc/hosts
and restarting the salt-minion service... is generally all that is
needed to get the minions connected.. approve the keys on the master and
start running commands and such.

David Boucha

unread,
Jun 15, 2013, 8:15:04 PM6/15/13
to salt users list

Also, fyi, salt-cloud has a new "saltify" driver that will allow you to remotely install salt on an existing system.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.

Grant Ashman

unread,
Jun 15, 2013, 8:52:44 PM6/15/13
to salt-...@googlegroups.com
Hi David,

The "saltify" driver sounds interesting. I haven't been able to find much documentation on it however and I'm really just scratching the surface at the moment experimenting with remote commands and stuff - so I'm a bit lost. Can you point me in the right direction?

Using Ansible or Fabric might work, but it's really adding another level of complexity to the equation that I'd rather not introduce in the production environment, we're looking at Salt as a great all-in-one solutions for configuration management that allows a relatively shallow learning curve and some immediate results - using something Ansible to deploy Salt seems a bit backward.

Using Zabbix to run some commands to bootstrap would be perfect, but it definitely would be a catch-22, by the time I've modified sudoers to allow the Zabbix user to run wget as sudo, I may as well have manually run the bootstrap - I'd also prefer not to allow my Zabbix user to run too much as root if possible.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.

David Boucha

unread,
Jun 15, 2013, 11:03:27 PM6/15/13
to salt users list
Reply all
Reply to author
Forward
0 new messages