Linux Command-Line Fetion for Nagios

Monitoring the status of production servers in real time is a fundamental skill for all operations personnel. Nagios, a server monitoring software, has been widely adopted for this purpose. By default, it notifies administrators via email, but the downside is that if you aren’t logged into your email, you won’t know the server status. As a result, ops teams have also leveraged Fetion (a Chinese SMS/messaging service) for notifications. Older Fetion tools no longer work, so here we provide a command-line Fetion client that supports the latest protocol. The official download site is: http://www.it-adv.net

Using Fetion with the default parameters for Nagios SMS sending can cause issues because the parameters contain the equals sign (=). To fix this, here is a Nagios SMS sending script.

01 #!/bin/sh
02 #Script name: sms
03 #Auther: snake
04 if [ $# -eq 4 ];then
05         phone="$1"
06         pass="$2"
07         msg="$3"
08         sendto="$4"
09         /usr/local/fetion/fetion --exit-on-verifycode=1 --mobile=$phone --pwd=$pass --to=$sendto --msg-utf8="$msg"
10 else
11         echo "Usage:"
12         echo "/usr/local/fetion/fetion.sh [phone_num] [password] [msg] [sendto]"
13 fi

Linux Version: fetion-linux.zip

 

Windows Version: fetion-win.rar

https://www.cnop.net/uploadfile/2014/0213/20140213111606846.rar

Leave a Comment

Your email address will not be published.