Pages

Monday, September 29, 2014

Ansible as remote executor in a Puppet environment

Ansible as remote executor in a Puppet environment

Thursday, September 25, 2014

Wednesday, September 24, 2014

Jenkins and Security

http://kimbouwman.wordpress.com/2014/04/20/doing-ci-jenkins-and-security/

Tuesday, September 23, 2014

Windows - Ruby from Git bash Command Line

Want to run Ruby command line from within the Git Bash command Line in Windows 7 ?

For some reason Git bash can not locate the ruby command ,

So edit the $PATH environemnt variable in Windows 7 and append below entry at the last

C:\HashiCorp\Vagrant\embedded\bin


Thursday, September 11, 2014

Check_MK MRPE

Check_mk provides a nice way to migrate your old NRPE based checks into Check_mk using MRPE

Although the documentation of MRPE is very comprehensive but today I messed the whole day with small issue.

I had written small script which  can connect to another host by ssh and collect some facts. The problem started when I was using the same command two times with different parameters.

e.g. check my mrpe.cfg

[root@appmon2 tmp]# cat  mrpe.cfg
### Just a Test
TEST1 ./test.sh ALL
TEST2 ./test.sh COLO

so despite I have defined two services , check_mk_agent is recongnizing only one,

[root@tiber tmp]# check_mk_agent
<<>>
(test.sh) TEST1 0 OK: ALL is Green

The whole issue was in the script test.sh I have used ssh to connect to remote host and which is causing the issue.

To fix this need to append the

[root@tiber tmp]# diff test.sh test1.sh
52,53c52
<       ssh root@$HA $command >> /tmp/juned.txt
---
>      
> /tmp/juned.txt
And now check_mk_agent is happy

<<>>
(test.sh) TEST1 0 OK: ALL is Green
(test.sh) TEST2 0 OK: app is Green


Edit : 2 July 2015
Once again messed with the same issue, and found that if you are using ssh inside mrpe its always advisable to Close stdin. to avoid the issue.

So in the function where you using the ssh command on remote host add <&- after the closing }.

e.g.

function execute_command {
        ssh root@$SRV $command >> /tmp/out.txt
        if [ $? -eq 0  ]; then
                msg="Green"
                sstatus=0
        else
                msg="Critical: Red"
                sstatus=2
        fi
}<&-

Friday, September 5, 2014

Dashing - Sinatra based dashboard

Being in Ops team, we require Dashboard all the time with lots of metrics , we have quite lots of Ops tool chain in production and each individual tool has its own home page which serves as its own dashboard. E.g.


  1. Check_Mk
  2. Jenkins
  3. Ganglia
  4. Memcached
  5. Mysql 
  6. graphite
  7. and lots of custom metrics dashboard built in PHP 
But we wanted a single unified Dashbord which level 1 team can watch infact presented on TV screen so that any one in the team can have glance of it. The dashboard should be simple and catchy so that the metrics can be easily seen.

Enter Dashing 


Dashing is a Sinatra based framework that lets you build beautiful dashboards.
Check out a demo over hereHere's another one, optimized for 1080p screens.
Key features:
  • Use premade widgets, or fully create your own with scss, html, and coffeescript.
  • Widgets harness the power of data bindings to keep things DRY and simple. Powered by batman.js.
  • Use the API to push data to your dashboards, or make use of a simple ruby DSL for fetching data.
  • Drag & Drop interface for re-arranging your widgets.
  • Host your dashboards on Heroku in less than 30 seconds.
This project was created at Shopify for displaying custom dashboards on TVs around the office.
Dashing is pretty simple to setup ( check their web site ) but the real power is its widgets which can be easily extented to any level and lots of Additional-Widgets are also available.

I have easily set up few dashboard's in Dashing , the cool thing is the data can be made available to widgets either push or pull way. So if you something already setup to collect the metrics you can just push the data to Dashing widget and easily seen in Dashboard.




Monitor Failed Jenkins Job

We use Jenkins quite differently :) ( I will write it the use case later ) , And although the Jenkins provides the Email alerting if the Job is unstable. But  in our scenario we wanted an aggregate Job monitoring for the jenkins job so that as soon as any of the Jenkins Job failed our level team got hold of it.

Below is the simple Python plugin I have written  to achieve this. This python script gets all jobs stats using the Jenkins API and then parses for the stability of the Job.

Wednesday, September 3, 2014

creating new vagrant box from existing vm

Nice article on converting the existing VM into docker box by Abhishek Tiwari

http://abhishek-tiwari.com/hacking/creating-a-new-vagrant-base-box-from-an-existing-vm