├── 1.jpg ├── 2.jpg ├── CentOS-Base.repo ├── Graphs.pm ├── README.md ├── config ├── epel-7.repo ├── nginx.conf ├── smokeping-2.6.11.tar.gz ├── smokeping-master.conf ├── smokeping.conf ├── smokeping.sh ├── spawnfcgi.ini └── tcpping /1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ILLKX/smokeping-onekey/8bfee6102c23bfd0726309650f7be98612854606/1.jpg -------------------------------------------------------------------------------- /2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ILLKX/smokeping-onekey/8bfee6102c23bfd0726309650f7be98612854606/2.jpg -------------------------------------------------------------------------------- /CentOS-Base.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Base.repo 2 | # 3 | # The mirror system uses the connecting IP address of the client and the 4 | # update status of each mirror to pick mirrors that are updated to and 5 | # geographically close to the client. You should use this for CentOS updates 6 | # unless you are manually picking other mirrors. 7 | # 8 | # If the mirrorlist= does not work for you, as a fall back you can try the 9 | # remarked out baseurl= line instead. 10 | # 11 | # 12 | 13 | [base] 14 | name=CentOS-$releasever - Base - mirrors.aliyun.com 15 | failovermethod=priority 16 | baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ 17 | gpgcheck=1 18 | gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 19 | 20 | #released updates 21 | [updates] 22 | name=CentOS-$releasever - Updates - mirrors.aliyun.com 23 | failovermethod=priority 24 | baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ 25 | gpgcheck=1 26 | gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 27 | 28 | #additional packages that may be useful 29 | [extras] 30 | name=CentOS-$releasever - Extras - mirrors.aliyun.com 31 | failovermethod=priority 32 | baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ 33 | gpgcheck=1 34 | gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 35 | 36 | #additional packages that extend functionality of existing packages 37 | [centosplus] 38 | name=CentOS-$releasever - Plus - mirrors.aliyun.com 39 | failovermethod=priority 40 | baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ 41 | gpgcheck=1 42 | enabled=0 43 | gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 44 | 45 | #contrib - packages by Centos Users 46 | [contrib] 47 | name=CentOS-$releasever - Contrib - mirrors.aliyun.com 48 | failovermethod=priority 49 | baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ 50 | gpgcheck=1 51 | enabled=0 52 | gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 53 | -------------------------------------------------------------------------------- /Graphs.pm: -------------------------------------------------------------------------------- 1 | # -*- perl -*- 2 | package Smokeping::Graphs; 3 | use strict; 4 | use Smokeping; 5 | 6 | =head1 NAME 7 | 8 | Smokeping::Graphs - Functions used in Smokeping for creating graphs 9 | 10 | =head1 OVERVIEW 11 | 12 | This module currently only contains the code for generating the 'multi target' graphs. 13 | Code for the other graphs will be moved here too in time. 14 | 15 | =head2 IMPLEMENTATION 16 | 17 | =head3 get_multi_detail 18 | 19 | A version of get_detail for multi host graphs where there is data from 20 | multiple targets shown in one graph. The look of the graph is modeld after 21 | the graphs shown in the overview page, except for the size. 22 | 23 | =cut 24 | 25 | sub get_colors ($){ 26 | my $cfg = shift; 27 | 28 | if ($cfg->{Presentation}{graphborders} eq 'no') { 29 | return '--border', '0', 30 | '--color', 'BACK#ffffff00', 31 | '--color', 'CANVAS#ffffff00'; 32 | } 33 | 34 | # Use rrdtool defaults 35 | return; 36 | } 37 | 38 | sub get_multi_detail ($$$$;$){ 39 | # a) 's' classic with several static graphs on the page 40 | # b) 'n' navigator mode with one graph. below the graph one can specify the end time 41 | # and the length of the graph. 42 | # c) 'a' ajax mode, generate image based on given url and dump in on stdout 43 | # 44 | my $cfg = shift; 45 | my $q = shift; 46 | my $tree = shift; 47 | my $open = shift; 48 | my $mode = shift || $q->param('displaymode') || 's'; 49 | my $phys_open = $open; 50 | if ($tree->{__tree_link}){ 51 | $tree=$tree->{__tree_link}; 52 | $phys_open = $tree->{__real_path}; 53 | } 54 | 55 | my @dirs = @{$phys_open}; 56 | 57 | return "
Time range: " 309 | . $q->textfield(-name=>'start',-default=>$startstr) 310 | . " to ".$q->textfield(-name=>'end',-default=>$endstr) 311 | . $q->hidden(-name=>'epoch_start',-id=>'epoch_start',-default=>$start) 312 | . $q->hidden(-name=>'epoch_end',-id=>'epoch_end',-default=>time()) 313 | . $q->hidden(-name=>'target',-id=>'target' ) 314 | . $q->hidden(-name=>'hierarchy',-id=>'hierarchy' ) 315 | . $q->hidden(-name=>'displaymode',-default=>$mode ) 316 | . " " 317 | . $q->submit(-name=>'Generate!') 318 | . "
" 319 | . $q->end_form(); 320 | 321 | $page .= "