Last active
December 22, 2015 02:49
-
-
Save haf/6406396 to your computer and use it in GitHub Desktop.
irb session against riemann
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
[root@zk-kafka vagrant]# nmap -p 5555,5556 172.16.0.60 | |
Starting Nmap 5.51 ( http://nmap.org ) at 2013-09-01 20:18 UTC | |
Nmap scan report for 172.16.0.60 | |
Host is up (0.00034s latency). | |
PORT STATE SERVICE | |
5555/tcp open freeciv | |
5556/tcp open unknown | |
MAC Address: 08:00:27:2D:BE:24 (Cadmus Computer Systems) | |
Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds |
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
$ sudo netstat -napt | |
Active Internet connections (servers and established) | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 4554/sshd | |
tcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 18591/riemann-dash | |
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 4744/master | |
tcp 0 0 10.0.2.15:22 10.0.2.2:60238 ESTABLISHED 27773/sshd | |
tcp 0 0 :::5555 :::* LISTEN 15781/java | |
tcp 0 0 :::5556 :::* LISTEN 15781/java | |
tcp 0 0 :::22 :::* LISTEN 4554/sshd | |
tcp 0 0 ::1:25 :::* LISTEN 4744/master | |
tcp 0 0 ::ffff:127.0.0.1:35851 ::ffff:127.0.0.1:5555 ESTABLISHED 15781/java | |
tcp 0 0 ::ffff:127.0.0.1:5555 ::ffff:127.0.0.1:35851 ESTABLISHED 15781/java | |
tcp 0 0 ::ffff:172.16.0.60:5556 ::ffff:172.16.0.1:56563 ESTABLISHED 15781/java | |
$ sudo supervisorctl | |
riemann RUNNING pid 15781, uptime 9:20:48 | |
$ sudo iptables -L -n | |
Chain INPUT (policy ACCEPT) | |
target prot opt source destination | |
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 /* 000 accept all icmp */ | |
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 /* 001 accept all to lo interface */ | |
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 /* 002 accept related established rules */ state RELATED,ESTABLISHED | |
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 5555 /* 100 allow riemann:5555 */ state NEW | |
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22 /* 100 allow ssh */ state NEW | |
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 5556 /* 101 allow riemann-websockets:5556 */ state NEW | |
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 4567 /* 201 allow riemann-dash:4567 */ state NEW | |
DROP all -- 0.0.0.0/0 0.0.0.0/0 /* 999 drop all */ | |
Chain FORWARD (policy ACCEPT) | |
target prot opt source destination | |
Chain OUTPUT (policy ACCEPT) | |
target prot opt source destination |
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
1.9.3p448 :032 > r | |
=> #<Riemann::Client:0x000000025e2570 @host="172.16.0.60", @port=5555, @timeout=5, @udp=#<Riemann::Client::UDP:0x000000025e2458 @host="172.16.0.60", @port=5555, @max_size=16384, @locket=#<Mutex:0x000000025e2430>, @socket=#<UDPSocket:fd 6>>, @tcp=#<Riemann::Client::TCP:0x000000025e2340 @host="172.16.0.60", @port=5555, @timeout=5, @locket=#<Mutex:0x000000025e2318>, @socket=#<TCPSocket:fd 7>>> | |
1.9.3p448 :033 > msg | |
=> {:host=>"www1", :service=>"another", :metric=>2.53, :state=>"critical", :description=>"Request took 2.53 seconds.", :tags=>["http"]} | |
1.9.3p448 :034 > r << msg | |
=> nil | |
1.9.3p448 :035 > r1 = Riemann::Client.new host: '::ffff:172.16.0.60' | |
=> #<Riemann::Client:0x000000025b42d8 @host="::ffff:172.16.0.60", @port=5555, @timeout=5, @udp=#<Riemann::Client::UDP:0x0000000259ff18 @host="::ffff:172.16.0.60", @port=5555, @max_size=16384, @locket=#<Mutex:0x0000000259fec8>>, @tcp=#<Riemann::Client::TCP:0x0000000259fea0 @host="::ffff:172.16.0.60", @port=5555, @timeout=5, @locket=#<Mutex:0x0000000259fe78>>> | |
1.9.3p448 :036 > r1 << msg | |
Errno::EAFNOSUPPORT: Address family not supported by protocol - sendto(2) | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client/udp.rb:45:in `send' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client/udp.rb:45:in `block in send_maybe_recv' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client/udp.rb:57:in `block in with_connection' | |
from <internal:prelude>:10:in `synchronize' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client/udp.rb:54:in `with_connection' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client/udp.rb:39:in `send_maybe_recv' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client.rb:86:in `send_maybe_recv' | |
from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/riemann-client-0.2.2/lib/riemann/client.rb:49:in `<<' | |
from (irb):36 | |
from /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/irb:16:in `<main>' | |
1.9.3p448 :037 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment