At Jamendo we use Skype a lot. Therefore i thought, that it would be nice to get Skype instant messages from the Zabbix Server. My requirements were:
- must run on Ubuntu Server
- no X.org, KDE or Gnome – it must be a light solution!
- just install packages with apt (except for skype) – don’t want to update some software by hand.
- init.d script, that starts the “skype notification service”
Installing the skype notification software
Installing the basic components:
# installing the user, that runs the service useradd skype # installing the x server apt-get install xvfb apt-get install fluxbox x11vnc # installing skype requirements apt-get install dbus apt-get install libasound2 libqt4-dbus libqt4-network libqtcore4 libqtgui4 libxss1 libpython2.6 libqt4-xml libaudio2 libmng1 fontconfig liblcms1 apt-get install lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 # wget http://www.skype.com/go/getskype-linux-beta-ubuntu-32 -O skype-linux-beta.deb wget http://www.skype.com/go/getskype-linux-beta-ubuntu-64 -O skype-linux-beta.deb # if there are other unresolved dependencies install missing packages using apt-get install and then install the skype deb package again dpkg -i skype-linux-beta.deb
# installing Skype4py wget 'http://sourceforge.net/projects/skype4py/files/skype4py/220.127.116.11/Skype4Py-18.104.22.168.tar.gz/download?use_mirror=switch' tar -xzf Skype4Py-22.214.171.124.tar.gz cd Skype4Py-126.96.36.199/ python setup.py install
Now we have all the things we need.
The next step we perform as skype user!
Just unpack these skypescripts.tar into the skype home directory.
Setting up the skype notification service
Please ensure, that you have vncviewer installed on your (local) ubuntu workstation.
- Log in to your server: ssh -L 5900:127.0.0.1:5900 ‘firstname.lastname@example.org’
- start xfvb, fluxbox and skype: ./start-server.sh start
- start the vnc server: ./start-vnc.sh start
- on your local ubuntu workstation you start vnc-viewer: vncviewer 127.0.0.1
- You should now be seeing the fluxbox desktop and skype
- Enter the username and password and ensure, that the credentials get saved.
- Go to settings and set the following options
- no chat history
- just people on my list can write me
- just people on my list can call me
- Send your first skype message on the server as skype user: ./sendim.sh ‘USERNAME’ ‘HELLO WORLD’
- Skype asks now, if skype4py should be allowed. Click on remember and allow!
- stop the vnc-server: ./start-vnc.sh stop
Now the skype service is up and running.
Configuring the zabbix server
That’s the easy part.
- Just check in your zabbix_server.conf to where the AlertScriptsPath points to.
- Then add a symbolic link of sendim.sh in this directory. ( Zabbix calls the script like this: scriptname username subject message )
- Go to the zabbix frontend and create the new Skype media type:
- Description: Skype
- Type: Script
- Script name: sendim.sh
- Finally, set up your skype address in your profile and check if you have an action, that sends messages to your all medias or skype media.
And that’s it, you should now receive messages from Zabbix. Just test by crashing your infrastructure…