1

I try to use Skype4Py for Nagios notifications. I already can send messages from command-line. Now I try to insert line-break character (carriage return) into body of message. I use the following scripts to send notifications: /usr/local/nagios/sbin/skype_alert.sh my_skype_login "RECOVERY\n" "Host: nagios-test\r" "Service: PING" "Info: PING OK 1.22ms":

#!/bin/bash
export DISPLAY=:0
PT=`which python`
SKYPE_LOGIN=$1
SKYPE_MESSAGE="${@:2}"
$PT /usr/local/nagios/sbin/skype_alert.py $SKYPE_LOGIN "$SKYPE_MESSAGE"

/usr/local/nagios/sbin/skype_alert.py:

#!/usr/bin/python
import Skype4Py
import sys
skype = Skype4Py.Skype()
skype.Attach()
user = sys.argv[1]
msg=' '.join(sys.argv[2:]) 
skype.SendMessage(user, msg)

Can somebody tell me how to insert line breaks (carriage return) in message? I tried \n \r and so on..

whi1test
  • 29
  • 8

1 Answers1

0

Here is solution: http://python.su/forum/topic/29784/?page=1#post-161885 Hope it help somebody)

whi1test
  • 29
  • 8