[ Launch Inlet ]
[ Launch Inlet ]
[ Launch Inlet ]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| s = TCPSocket.new("zabbixserver", 10051) | |
| s.write message.to_s | |
| response_header = s.recv(5) | |
| if not response_header == "ZBXD\1" | |
| puts "response: #{response_header}" | |
| raise 'Got invalid response' | |
| end | |
| response_data_header = s.recv(8) | |
| response_length = response_data_header[0,4].unpack("i")[0] | |
| response_raw = s.recv(response_length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'json' | |
| msg = { | |
| "request" => "sender data", | |
| "data" => [ | |
| { | |
| "host" => "myappserver", | |
| "key" => "mydata", | |
| "value" => "1", | |
| }] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| host_list=(<%= wemux_hosts %>) | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class wemux($wemux_hosts = 'foobar'){ | |
| package{"epel-release": | |
| provider => rpm, | |
| source => "http://linux.mirrors.es.net/fedora-epel/6/i386/epel-release-6-7.noarch.rpm", | |
| ensure => installed, | |
| } | |
| package{"tmux": | |
| ensure => installed, | |
| require => Package["epel-release"], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class{"wemux": | |
| wemux_hosts => "vagrant" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exec{"configure-wemux": | |
| command => "/bin/sed -i -e 's/change_this/vagrant/g' /usr/local/etc/wemux.conf && touch /etc/wemux-configured", | |
| creates => "/etc/wemux-configured", | |
| require => Exec["cp-wemux-conf"], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exec{"clone-wemux-repo": | |
| command => "/usr/bin/git clone git://github.com/zolrath/wemux.git /usr/local/share/wemux", | |
| creates => "/usr/local/share/wemux", | |
| } | |
| exec{"symlink-wemux-into-path": | |
| command => "/bin/ln -s /usr/local/share/wemux/wemux /usr/local/bin/wemux", | |
| creates => "/usr/local/bin/wemux", | |
| } |