[chef] ohai network ports plugin


Chronological Thread 
  • From: Anthony Goddard < >
  • To:
  • Subject: [chef] ohai network ports plugin
  • Date: Mon, 4 Apr 2011 09:44:49 -0400

Hi all,
I wrote my first ohai plugin yesterday, based on a little ruby script which emulates netstat. The plugin extends the network attribute by adding which tcp / udp ports are bound on which interfaces. I saw that there was another similar plugin which used sigar, but I wanted something that didn't have any external dependencies (and it was a good excuse to see what writing a plugin was like). Going this route made it hard to get the process that's bound to the port without root access though (as far as I could tell..)

Anyhow, the following is the hierarchy of the output under "network"  (hopefully this HTML makes it through intact). The plugin can be found here: https://github.com/agoddard/ohai-plugins/blob/master/plugins/network_ports.rb

I don't think it's perfect & would really love to hear any feedback that people have.

Cheers,
Anthony

ports
tcp
0
1
2
3
udp
0
1


  • [chef] ohai network ports plugin, Anthony Goddard, 04/04/2011

Archive powered by MHonArc 2.6.16.

§