亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? kannel.monitor

?? 主要包括sms網(wǎng)關(guān)和wap網(wǎng)關(guān)實(shí)現(xiàn)說明和源碼
?? MONITOR
字號(hào):
#!/usr/bin/perl## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundation; either version 2 of the# License, or (at your option) any later version.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# General Public License for more details.# You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307# USA ### Revision $Id: kannel.monitor,v 1.4 2003/05/24 16:31:18 davi Exp $## Ingo Brombach <brombach@wapme-systems.de>#use warnings;use LWP::UserAgent; use XML::Parser;use Sys::Hostname;use Getopt::Std;getopts('P:s:p:f:n:ivhS',\%opts);my $p = new XML::Parser(ErrorContext  => 2,                        Namespaces    => 1,                        ParseParamEnt => 1,                        Handlers      => {Start => \&sthndl,                                          Char  => \&chrhndl                                         }                        );local $scount=0; # SMS-Level - Counterlocal $bcount=0; # Box-Level - Counter local $kannel_status;local $status_file='/tmp/kannel_monitor.status';local $qlimit=1; # Maximum Number of queued messages per minutelocal $port = ($opts{p}) ? $opts{p} : "13000";local $statussheet = ($opts{s}) ? $opts{s} : "status.xml";local $password = ($opts{P}) ? $opts{P} : "";local $http = ($opts{S}) ? "https" : "http";local @failures;&usage if ($opts{h}|| !($opts{f} || @ARGV));if ($opts{f}){    my $file=$opts{f};    die "Can磘 find '$file' : $!\n" unless -f $file;    $p->parsefile ($file);    &show if $opts{i};    @failures=@{&analyze()};}else{    foreach $host (@ARGV){	$url=$http."://".$host.":".$port."/".$statussheet."?password=".$password;         &info("# GET URL $url ... \n");        my $ua = LWP::UserAgent->new(env_proxy => 1,                                  keep_alive => 1,                                  timeout => 10,                                  );        my $response=$ua->get($url)||        do { &err($host);&info("GET request to $host failed \n");next};        &info("OK\n");        if ((${$response}{'_content'})){            my $doc=${$response}{'_content'};            $p->parse($doc);        } # end if        else{do { &err($host);&info("GET request to $host failed \n");next}}        &show if $opts{i};        push @failures, @{&analyze()};    }        } # end elseif (@failures == 0) {    exit 0;}print "@failures\n" unless $opts{v};exit 1;################## End main################sub usage{    $0 =~ s,.*/,,g;    my $program=$0;    printf("\n");print <<"EOU";$program  --  Kannel monitoring module for 'mon'  This Perl script is a custom monitoring module for mon, the system monitoring  tool, see http://www.kernel.org/pub/software/admin/mon/. The module watchs for  availibility of the Kannel SMS gateway, basicaly it checks the state of the   connected SMSC links. In case of an error it will returns the affected SMSC IDs  of the links.  2002-07-31 Ingo Brombach, <brombach\@wapme-systems.de>USAGE:  $program [options] hosts...      where options can be any of:  -h                this help message  -n "smsc-ids..."  a list of smsc-ids that should be ignored by the test  -s URI            the URI on the hosts containing the status-document (default: $statussheet)  -p port           the port to connect to (default: $port)  -S                use https:// scheme to access the URI (via SSLv3) (default: http://)  -P password       the status-password (default: $password)  -f file           local XML file to read (mainly for testing)  -v                verbose output  -i                info mode, displays the whole information to stdout  Examples:     $program -i -v -n "smpp_foo smpp_bar" kannel.foobar.com    Checks out the status page status.xml (default) on kannel.foobar.com,     port 13000 (default) without password. It lookes for the general     status as well as for the status of the smsc-connections but ignores     error on the smsc-ids smpp_foo and smpp_bar. The whole status is displayed.     The failure messages are verbose.    $program -i -v -f status.xml -n "smpp_foo smpp_bar"    The same as above, but reading from a local status.xml file    $program -p 13001 -P secret kannel.foobar.com              Looking for status on port 13001 with password "secret". Only failing     smsc-ids are displayed.             EOU    exit 1;}sub info { print STDERR @_ if $opts{v}; }     # Output Verbose-Modussub err {    my $host=$_[0];    push @failures, $host;}sub pushall{    my @failures;    for ($count=1;$count>=0;$count++){        last unless (exists ${"smsc".$count}{id});        push @failures, ${"smsc".$count}{id};    } # end for    return \@failures;}sub analyze{    my @failures;    # Bearerbox does not run:    #==============================    if (! $kannel_status || (split /,/,$kannel_status)[0] ne 'running'){        info "bearerbox is not running\n";        return &pushall;     } # end if (Bearerbox)    # SMS-or WAPBox does not run:    #==============================    for ($count=1;$count>=0;$count++){	if ($count==1 && ! ${"box".$count}{'status'}){    	    info "No SMS- or WAP-Box is running!!\n";	    push @failures, "No SMS- or WAP-Box is running!!\n";	} #end if	elsif ((${"box".$count}{'status'}	       &&(split /\s+/,${"box".$count}{'status'})[0] ne 'on-line')){	    info ${"box".$count}{'type'}." is not running!!\n";	    push @failures, hostname().": ".${"box".$count}{'type'}." is not running!!\n";	} # end elsif    	last unless (${"box".$count}{'type'}		     &&((${"box".$count}{'type'} eq 'smsbox')		     || (${"box".$count}{'type'} eq 'wapbox')));    } # end for count (SMS-Box)        # SMSC does not run:    #==============================        for ($count=1;$count>=0;$count++){        last unless (exists ${"smsc".$count}{id});        if (${"smsc".$count}{id}){                      $exists{${"smsc".$count}{id}}=1;            if ((split /\s+/,${"smsc".$count}{status})[0] ne 'online'){            local $smsc_not;                if ($opts{n}){                    foreach $smsc (split /\s+/, $opts{n}){                        $smsc_not=1 if $smsc eq ${"smsc".$count}{id};                    } # end foreach smsc                } # end if $opts{n}                unless ($smsc_not){                    info "SMSC  ".${"smsc".$count}{id}.                        " is in status \"".                        (split /\s+/,${"smsc".$count}{status})[0]."\"\n";                    push @failures, ${"smsc".$count}{id};                } #end unless $smsc_not            } # end if split        } # end if smsc    } # end for count    # SMSC does not exist:    #==============================    if ($opts{n}){        foreach $arg (split /\s+/, $opts{n}){            unless (exists $exists{$arg}){                info "$arg does not exist\n";                push @failures, $arg;            } #end unless        } # end foreaceh    } # end of $opts{n}                 # Kannel is queueing:    #==============================    open (STATUSFILE,"<$status_file") or        push @failures, hostname().": Could not open $status_file: $!";    local $warncount=0;    while (<STATUSFILE>){        my ($field,$value,$time,$diffmin);        ($field,$value,$time)=split /\|/, $_,3;        $diffmin=(time - $time)/60;                if ((${"sms"}{$field} - $value)/$diffmin >= $qlimit){            $warncount+=1;        } # end if    } # end while STATUSFILE        if ($warncount){        info "Kannel is queueing - please take a look\n";        return &pushall;    }    close(STATUSFILE);        open (STATUSFILE,">$status_file") or    push @failures, hostname().": Could not open $status_file: $!";         foreach $field (keys %{"sms"}){         if ((split /_/,$field)[1]             &&(split /_/,$field)[1] eq 'queued'){             printf(STATUSFILE "%s|%s|%d\n",                     $field,${"sms"}{$field},time);         } # end if     } # end foreach    close(STATUSFILE);    return \@failures;}sub show{     my $count=1;     my $bcount=1;    if ($kannel_status){        printf("============== Status ===================\n");        printf("%s\n", $kannel_status);        printf("=========================================\n");    } # end elsif     printf("============SMS Overall==================\n");     foreach $field (keys %{"sms"}){         printf("%s -> %s\n", $field,${"sms"}{$field});     }     printf("=========================================\n");     printf("=================BOXES===================\n")          if (exists ${"box".$bcount}{type});    while (exists ${"box".$bcount}{type}){        foreach $field (keys %{"box".$bcount}){            printf("%s -> %s\n", $field,${"box".$bcount}{$field});        } # end foreach        ++$bcount;        printf("=========================================\n");    } # end while    if (exists ${"smsc".$count}{id}){         printf("\n================SMSC磗===================\n");         printf("=========================================\n") ;    }    while (exists ${"smsc".$count}{id}){        foreach $field (keys %{"smsc".$count}){            printf("%s -> %s\n", $field,${"smsc".$count}{$field});        } # end foreach        printf("=========================================\n");        ++$count;    } # end while} # End showsub sthndl {  my $xp = shift;  my $el = shift;  my $nm = $xp->namespace($el) ? "n1:$el" : $el;  $parent{$nm}=$xp->current_element;}  # End sthndlsub chrhndl {  my ($xp, $data) = @_;  my (@level);  my $value= sprintf("%s\n",$xp->xml_escape($data, '>', "\xD"));  my $level = $xp->current_element;  chomp $value;  if ($value!~/^\s+$/){        while($level=$parent{$level}){            unshift @level, $level;        }                   push @level, $xp->current_element;                     if (($level[0] eq 'gateway') && ($level[1] eq 'smscs')            && ($level[2] eq 'smsc')&& ($level[3])){              ++$scount if $level[3] eq 'name';              ${"smsc".$scount}{$level[3]}=$value;          } # end if            elsif (($level[0] eq 'gateway') && ($level[1] eq 'status')){            $kannel_status=$value;        } # end elsif        elsif (($level[0] eq 'gateway') && ($level[1] eq 'boxes')               && ($level[2] eq 'box')&& ($level[3])){              ++$bcount if $level[3] eq 'type';              ${"box".$bcount}{$level[3]}=$value;                   } # end elsif           elsif (($level[0] eq 'gateway') && ($level[1] eq 'sms')){            if (($level[2] eq 'sent'||$level[2] eq 'received') && $level[3]){                ${'sms'}{$level[2].'_'.$level[3]}=$value;            } # end if             else{                ${'sms'}{$level[2]}=$value;            } # end else        } # end elsif       }}  # End chrhndl# Tell emacs that this is really a perl script#Local Variables:#Mode: perl#End:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆成人久久精品二区三区红| 91精品国产综合久久婷婷香蕉 | 中文字幕五月欧美| 欧美高清在线一区二区| 国产欧美精品日韩区二区麻豆天美| 亚洲精品一区二区三区影院 | 久久精品亚洲精品国产欧美kt∨| 精品国产一区二区三区久久影院| 久久综合成人精品亚洲另类欧美 | 久久www免费人成看片高清| 日韩高清国产一区在线| 免费在线看成人av| 蜜桃视频免费观看一区| 精品制服美女丁香| 国产高清亚洲一区| 99视频在线精品| 日本道色综合久久| 欧美一区二区高清| 久久精品一区二区三区四区| 久久精品男人的天堂| 亚洲特黄一级片| 亚洲电影一级片| 精品一区二区三区在线视频| 大白屁股一区二区视频| 91在线免费视频观看| 欧美亚洲一区二区三区四区| 日韩一卡二卡三卡四卡| 国产日韩视频一区二区三区| 亚洲精品大片www| 麻豆精品久久精品色综合| 国产一区二区美女| 色综合久久久网| 欧美一区三区二区| 国产欧美日韩另类一区| 一区二区三区日本| 免费成人你懂的| 99久久综合色| 欧美大片免费久久精品三p| 国产免费观看久久| 亚洲图片欧美色图| 国产精品99久久久久久久vr| 欧美在线观看你懂的| 26uuu国产电影一区二区| 亚洲欧美日韩国产综合在线| 蜜臀av性久久久久蜜臀av麻豆 | 制服丝袜亚洲精品中文字幕| 久久九九久久九九| 亚洲成人激情自拍| 国产成人久久精品77777最新版本| 91免费视频观看| 精品欧美一区二区三区精品久久| |精品福利一区二区三区| 免费在线成人网| 91麻豆文化传媒在线观看| 日韩欧美在线综合网| 亚洲天堂中文字幕| 精品一区二区三区香蕉蜜桃| 欧美性猛交一区二区三区精品| 2017欧美狠狠色| 一区二区欧美国产| 国产91清纯白嫩初高中在线观看| 3d动漫精品啪啪| 亚洲精品你懂的| 国产盗摄女厕一区二区三区| 欧美一区二区在线免费观看| 国产精品成人免费| 国产一区二区三区黄视频 | 天堂在线一区二区| www.av精品| 久久精品一级爱片| 日本视频在线一区| 色噜噜狠狠色综合中国| 国产区在线观看成人精品| 日本欧美在线看| 欧美午夜在线一二页| 1区2区3区欧美| 国产成人一区在线| 26uuu亚洲综合色欧美| 三级不卡在线观看| 欧美亚洲日本一区| 夜色激情一区二区| jlzzjlzz欧美大全| 国产女人18毛片水真多成人如厕| 美女视频黄 久久| 91精品福利在线一区二区三区| 一级精品视频在线观看宜春院| 成人短视频下载| 国产日韩欧美电影| 国产精品中文字幕欧美| 欧美变态tickle挠乳网站| 日本欧美加勒比视频| 3d动漫精品啪啪1区2区免费| 五月综合激情网| 欧美日本一区二区在线观看| 亚洲午夜成aⅴ人片| 欧美亚洲国产bt| 亚洲综合一二区| 在线视频你懂得一区| 伊人色综合久久天天人手人婷| 91一区二区在线| 亚洲人成在线观看一区二区| 99久久精品情趣| 亚洲视频狠狠干| 91黄色免费网站| 亚洲电影第三页| 91精品国产综合久久蜜臀| 日本午夜一本久久久综合| 69p69国产精品| 久久99精品久久久久久国产越南| 日韩精品一区二区三区视频播放| 美腿丝袜一区二区三区| 欧美大片免费久久精品三p| 韩国v欧美v日本v亚洲v| 国产网站一区二区| 99精品国产视频| 亚洲国产一区二区三区青草影视| 欧美日韩精品久久久| 蜜桃免费网站一区二区三区| 久久久综合九色合综国产精品| 国产福利精品一区二区| 日韩理论片网站| 欧美三级视频在线| 免费av成人在线| 久久综合成人精品亚洲另类欧美| 国产成人福利片| 亚洲乱码一区二区三区在线观看| 欧美伊人久久久久久久久影院| 日韩电影在线观看一区| 精品国产乱码久久久久久影片| 福利电影一区二区| 一区二区三区鲁丝不卡| 欧美一级一区二区| 成人影视亚洲图片在线| 亚洲精品国产无天堂网2021| 91精品国产手机| 国产91露脸合集magnet| 一区二区三区 在线观看视频| 欧美一区日韩一区| 不卡一卡二卡三乱码免费网站| 亚洲一区二区在线观看视频| 精品久久99ma| 91麻豆产精品久久久久久| 午夜精品久久一牛影视| 国产三级一区二区三区| 欧美午夜理伦三级在线观看| 狠狠色丁香婷婷综合| 亚洲精品欧美在线| 久久综合色之久久综合| 在线观看日韩国产| 国产中文字幕精品| 亚洲成人av一区| 欧美激情综合在线| 7777精品伊人久久久大香线蕉超级流畅 | 成人午夜在线免费| 五月激情综合色| 中文乱码免费一区二区| 91精品婷婷国产综合久久性色| 成人精品鲁一区一区二区| 亚洲123区在线观看| 中文字幕国产一区| 日韩欧美视频一区| 欧洲精品中文字幕| 国产不卡在线播放| 免费在线视频一区| 亚洲精品国产视频| 国产拍欧美日韩视频二区| 91精品国产综合久久精品app| 99久久久免费精品国产一区二区| 麻豆91精品视频| 亚洲国产综合在线| 亚洲视频在线一区二区| 国产三级欧美三级日产三级99| 欧美电影一区二区| 91国产免费看| 不卡的电影网站| 国产成人免费视| 精品亚洲porn| 日韩精彩视频在线观看| 亚洲影院免费观看| 综合在线观看色| 欧美高清在线视频| 久久亚洲捆绑美女| 日韩欧美国产小视频| 欧美日韩黄色影视| 在线视频你懂得一区| 91麻豆免费看片| www.亚洲色图.com| 成人性色生活片| 国产传媒久久文化传媒| 美日韩黄色大片| 男女视频一区二区| 日韩在线播放一区二区| 亚洲成人在线免费| 一区二区免费看| 一区二区三区不卡在线观看 | 国产成人亚洲综合a∨婷婷图片| 麻豆高清免费国产一区| 人人精品人人爱| 麻豆国产欧美日韩综合精品二区 | 成人动漫一区二区在线|