Érre o quê!? Monitoramento ativo via MSN Messenger

Eu estava ouvindo Tool - Hooker with a penis quando me ocorreram algumas idéias. Geralmente, alertas de monitoramento ou de chamados (helpdesk) chegam por e-mail, ou você tem ir em uma página web, atualizar para ver se tem algo novo, etc. Neste meio tempo, é bem simples dar atenção a alguma conversa no MSN, e principalmente se a janela for de alguma delicinha, e foi justamente pensando neste tipo de situaçao que surgiu ele (ou seria ela!?): rööker.rb, um bot para MSN, que possibilita monitoramento ativo dos serviços.

O que o rööker.rb faz:

- existe uma base com todos os clientes, contendo o quê (serviços) roda em quem (empresa);

- existe uma checagem constante dos serviços. Se algum deles cai, no mesmo momento é gerado um alarme, e através deste alarme é possível saber o quê parou em quem;

- no mesmo momento, uma mensagem no MSN é recebida, e esta mensagem traz informações sobre qual serviço parou e em qual empresa. Agora entra a intervenção, ficando a critério “deixar de lado” (pois o chamado não foi aberto pela empresa ainda), ou fazer o serviço voltar;

Na janela do chat é possível digitar comandos, por exemplo:

#c0344 httpd restart

Esta mensagem que envio diz o seguinte: deve ser reiniciado o Apache no cliente c0344. Então o “rööker” conecta via SSH no cliente e faz todo o serviço, simples assim.

Tem mais coisa a ser feita: alarmes via gTalk e twitter. Quando tudo estiver redondinho eu posto o fonte aqui. Estou testando tudo em Linux (CentOS 5.2) e OpenBSD (4.4).

pfdoc.rb - the sexiest way to document your pf.conf (openbsd packet filter)

pfdoc.rb is a parser which makes your pf.conf looks very sexy by writing an elegant documentation (from here just called as pfdoc).

First scenario: you have a medium to large client with almost 900 lines of conf. Everything works fine even with your quick fixes, redundant rules, etc. Someday your boss (who you love) request a paper with your firewall rules for some audit and you’ll have two hours to delivery entire work… (need I say more?)

Second scenario: you have all your macros, tables, queues, rules or anything else, commented and described, line per line, all what you did, how traffic works, wich services are (dis)allowed, what ip’s are blocked, etc.

If all you want is bring your work to the world in a pretty (sexy and stylish) way pfdoc will fit your needs.

pfdoc is entire written in Ruby; design (final .html, generated when you pfdocsify {WTF?!} your pf.conf) by pingfoo (LoadFoO).

Only MACROS are recognized at this time. You can view a sample here.

pfXXX - A Simple Interface for OpenBSD Packet Filter (written in Ruby on Rails!)

pfXXX its a (quite) simple tool to talk with PF (OpenBSD Packet Filter). Currently, it shows only: tables, rules and logs.

ToDo list:

* edit tables (CRUD :S)

* edit rules (why not?!)

* show logs more eyecandy (and too subjective, explaining the rules)

* graphics

I know exists N hundred of apps like this but mine is written in Rails, is human readable, dry, and “mine” (which “mine” means I did; not stoled, not ripped off anyone, etc, etc :S)

PF Logs

PF Rules

PF Tables

PF Tables - opened

How-To: Install Ruby on Rails (OpenBSD 4.2, two steps)

1 - set PKG_PATH to whatever fit your needs

2 - pkg add -vv -i ruby ruby-gems ruby-rails ruby-mongrel

… and they lived happily ever after.