<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<channel>
	<title>flyinweb's blog - 服务器监控</title>
	<link>http://www.517sou.net/Folder/monitoring/Index.aspx</link>
	<language>zh-CN</language>
	<webMaster>shanyiwan@msn.com(flyinweb)</webMaster>
	<pubDate>Mon, 15 Jun 2009 19:31:16 GMT</pubDate>
	<copyright>Copyright 2007-2009. All rights reserved.</copyright>
	<generator>Bitrac Free Version</generator>
	<description>桃李无言，下自成蹊</description>
	<image>
		<title>flyinweb&apos;s blog</title>
		<url>http://www.517sou.net/Client/Banner.gif</url>
		<link>http://www.517sou.net/</link>
		<description>桃李无言，下自成蹊</description>
	</image>
	<item>
		<link>http://www.517sou.net/Article/Cacti-SMS-alarm.aspx</link>
		<title>cacti短信报警</title>
		<author>shanyiwan@live.com()</author>
		<category>服务器监控</category>
		<pubDate>Tue, 26 Jul 2011 10:09:14 GMT</pubDate>
		<description>&lt;p&gt;【描述】&lt;/p&gt;&lt;p&gt;网上有很多提示cacti的短信报警，主要有用飞信或者是通过邮件，使用139邮箱之类，本文修改cacti的源码来实现短信报警机制。实现方式很简单，通过触发URL来实现手机短信报警（有自己的短信接口）。&lt;/p&gt;&lt;p&gt;【实现方式】&lt;/p&gt;&lt;p&gt;软件安装&lt;/p&gt;&lt;p&gt;CactiStable : 0.8.7g&lt;br /&gt;SpineStable : 0.8.7g&lt;br /&gt;Plugin ArchitectureStable : 2.8&lt;br /&gt;Monitor&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.8.2&lt;br /&gt;Settings&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.5&lt;br /&gt;Thold&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0.4.3&lt;/p&gt;&lt;p&gt;&lt;b&gt;第一步：打开plugins\settings\setup.php&lt;/b&gt;&lt;/p&gt;&lt;p&gt;修改:&lt;/p&gt;&lt;pre&gt;&lt;ol class=&quot;dp-c&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;vars&quot;&gt;$tabs&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;mail&apos;&lt;/span&gt;&lt;span&gt;]&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;Mail&amp;nbsp;/&amp;nbsp;Mobile&apos;&lt;/span&gt;&lt;span&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p&gt;在$temp数组下增加如下代码：&lt;/p&gt;&lt;pre&gt;&lt;ol class=&quot;dp-c&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;settings_mobile_header&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;&lt;span&gt;( &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;friendly_name&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;Mobile&amp;nbsp;Options&amp;quot;&lt;/span&gt;&lt;span&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;method&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;spacer&amp;quot;&lt;/span&gt;&lt;span&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;), &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;settings_mobile_number&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;array&lt;/span&gt;&lt;span&gt;( &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;friendly_name&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;Mobile&amp;nbsp;Number&amp;quot;&lt;/span&gt;&lt;span&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;description&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;This&amp;nbsp;is&amp;nbsp;the&amp;nbsp;China&amp;nbsp;Mobile&amp;nbsp;Number&amp;nbsp;that&amp;nbsp;the&amp;nbsp;dead&amp;nbsp;host&amp;nbsp;notifications&amp;nbsp;will&amp;nbsp;be&amp;nbsp;sent&amp;nbsp;to.&amp;quot;&lt;/span&gt;&lt;span&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;method&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;textbox&amp;quot;&lt;/span&gt;&lt;span&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;max_length&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;gt;&amp;nbsp;255, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;div class=&quot;wp_codebox&quot;&gt;到此setup.php修改完成，打开web 界面可以看到如下：&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.jiunile.com/cacti%e7%9f%ad%e4%bf%a1%e6%8a%a5%e8%ad%a6-%e9%ab%98%e7%ba%a7%e7%af%87.html/1-19&quot; rel=&quot;attachment wp-att-723&quot; target=&quot;_blank&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-723&quot; title=&quot;1&quot; alt=&quot;&quot; src=&quot;http://www.517sou.net/Attach/month_1107/tguzml_182837_1.jpg&quot; width=&quot;733&quot; height=&quot;466&quot; /&gt;&lt;/a&gt;&lt;br /&gt;支持多个号码，号码之间用英文逗号分隔&lt;/p&gt;&lt;p&gt;&lt;b&gt;第二步：将内容发送到手机上，具体操作如下：&lt;/b&gt;&lt;/p&gt;&lt;p&gt;打开plugins\thold\thold_functions.php&lt;/p&gt;&lt;p&gt;修改thold_mail 这个函数，大约在1350行，在下面这段代码前加入以下代码&lt;/p&gt;&lt;pre&gt;&lt;ol class=&quot;dp-c&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;&amp;nbsp;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$Mailer&lt;/span&gt;&lt;span&gt;-&amp;gt;send(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$text&lt;/span&gt;&lt;span&gt;)&amp;nbsp;==&amp;nbsp;false)&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;ERROR:&amp;nbsp;&apos;&lt;/span&gt;&lt;span&gt;&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$Mailer&lt;/span&gt;&lt;span&gt;-&amp;gt;error()&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$Mailer&lt;/span&gt;&lt;span&gt;-&amp;gt;error(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span&gt;;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;div class=&quot;wp_codebox&quot;&gt;加入的代码为：&lt;/div&gt;&lt;pre&gt;&lt;ol class=&quot;dp-c&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;comment&quot;&gt;//发送短信&amp;nbsp;&amp;nbsp;(2011-07-26) &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;preg_match(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$subject&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ip&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;preg_match(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;/-(.*)]/&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$subject&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;vars&quot;&gt;$flag&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;stristr&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$subject&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;normal&apos;&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;str_replace&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;-&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;str_replace&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&apos;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;[0])); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;&amp;nbsp;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$flag&lt;/span&gt;&lt;span&gt;)&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ip&lt;/span&gt;&lt;span&gt;[0]&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&amp;nbsp;is&amp;nbsp;OK:&apos;&lt;/span&gt;&lt;span&gt;&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;strip_tags&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;}&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ip&lt;/span&gt;&lt;span&gt;[0]&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;&amp;nbsp;has&amp;nbsp;problem:&apos;&lt;/span&gt;&lt;span&gt;&amp;nbsp;.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;func&quot;&gt;strip_tags&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$message&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;thold_mms(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;);&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;div class=&quot;wp_codebox&quot;&gt;将发送到手机上的短信内容做了处理。大家可以根据自己的实际情况做修改&lt;br /&gt;这下面最主要的就是thold_mms这个函数了，将这个函数添加到thold_mail 函数下&lt;br /&gt;代码如下：&lt;/div&gt;&lt;pre&gt;&lt;ol class=&quot;dp-c&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&lt;span class=&quot;comment&quot;&gt;/*&amp;nbsp;sms&amp;nbsp;*/&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;&amp;nbsp;thold_sms(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;)&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$number&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;db_fetch_row(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;SELECT&amp;nbsp;value&amp;nbsp;FROM&amp;nbsp;settings&amp;nbsp;WHERE&amp;nbsp;name&amp;nbsp;=&amp;nbsp;&apos;settings_mobile_number&apos;&amp;quot;&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$mobile_string&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$number&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&apos;value&apos;&lt;/span&gt;&lt;span&gt;]; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$mms_content&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;iconv(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;GB2312&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$content&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$API_Endpoint&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;http://api.mysmsurl.com/s.aspx&amp;quot;&lt;/span&gt;&lt;span&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$nvpStr&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;n=&amp;quot;&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$mobile_string&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&amp;quot;&amp;amp;m=&amp;quot;&lt;/span&gt;&lt;span&gt;.urlencode(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$mms_content&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;curl_init(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_URL,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$API_Endpoint&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_VERBOSE,&amp;nbsp;1); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_SSL_VERIFYPEER,&amp;nbsp;FALSE); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_SSL_VERIFYHOST,&amp;nbsp;FALSE); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_RETURNTRANSFER,1); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,&amp;nbsp;CURLOPT_POST,&amp;nbsp;1); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_setopt(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;,CURLOPT_POSTFIELDS,&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$nvpStr&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$response&lt;/span&gt;&lt;span&gt;&amp;nbsp;=&amp;nbsp;curl_exec(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&lt;span&gt;(curl_errno(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;)){ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$curl_error_no&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;gt;=curl_errno(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;)&amp;nbsp;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$curl_error_msg&lt;/span&gt;&lt;span&gt;&amp;gt;=curl_error(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;else&lt;/span&gt;&lt;span&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;curl_close(&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$ch&lt;/span&gt;&lt;span&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;vars&quot;&gt;$response&lt;/span&gt;&lt;span&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;</description>
		<guid>http://www.517sou.net/Article/Cacti-SMS-alarm.aspx</guid>
		<trackback:ping>http://www.517sou.net/Article/637/Trackback.ashx</trackback:ping>
		<comments>http://www.517sou.net/Article/Cacti-SMS-alarm.aspx#CommentPostAnchor</comments>
		<wfw:commentRss>http://www.517sou.net/Article/637/Feeds.ashx</wfw:commentRss>
	</item>
</channel>
</rss>
