├── .gitattributes ├── .gitignore ├── README.md ├── zabbix-2.0.x ├── .gitattributes ├── .gitignore ├── My97DatePicker │ ├── WdatePicker.js │ ├── calendar.js │ ├── lang │ │ ├── en.js │ │ ├── zh-cn.js │ │ └── zh-tw.js │ └── skin │ │ ├── WdatePicker.css │ │ ├── datePicker.gif │ │ ├── default │ │ ├── datepicker.css │ │ └── img.gif │ │ └── whyGreen │ │ ├── bg.jpg │ │ ├── datepicker.css │ │ └── img.gif ├── README.md ├── ZabbixApi.class.php ├── ZabbixApiAbstract.class.php ├── addfile │ ├── CItemValue.php │ ├── class.cchart_zabbix.php │ ├── class.cgraphdraw_zabbix.php │ ├── class.cimagetexttable_zabbix.php │ ├── zabbix.php │ └── zabbix_chart.php ├── big_graph.php ├── graph.php ├── left.php ├── page.class.php ├── screenshots │ ├── 1.jpg │ ├── 2.jpg │ ├── IMG_7649.JPG │ ├── IMG_7650.JPG │ └── yunweibang-weixin.jpg ├── static │ ├── blank.gif │ ├── fancybox_buttons.png │ ├── fancybox_loading.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── jquery-1.4.4.min.js │ ├── jquery-2.0.3.min.js │ ├── jquery.fancybox.min.css │ ├── jquery.fancybox.min.js │ ├── jquery.ztree.core-3.5.js │ ├── line_conn.gif │ ├── loading.gif │ ├── page.css │ ├── zTreeStandard.gif │ ├── zTreeStandard.png │ ├── zTreeStyle.css │ └── ztreedemo.css ├── zabbix.php ├── zabbix_ajax.php └── zabbix_config.php ├── zabbix-2.2.x ├── .gitattributes ├── .gitignore ├── My97DatePicker │ ├── WdatePicker.js │ ├── calendar.js │ ├── lang │ │ ├── en.js │ │ ├── zh-cn.js │ │ └── zh-tw.js │ └── skin │ │ ├── WdatePicker.css │ │ ├── datePicker.gif │ │ ├── default │ │ ├── datepicker.css │ │ └── img.gif │ │ └── whyGreen │ │ ├── bg.jpg │ │ ├── datepicker.css │ │ └── img.gif ├── README.md ├── ZabbixApi.class.php ├── ZabbixApiAbstract.class.php ├── addfile │ ├── API.php │ ├── CGraphDraw_Zabbix.php │ ├── CImageTextTable_Zabbix.php │ ├── CItemValue.php │ ├── CLineGraphDraw_Zabbix.php │ ├── main.js │ ├── menu.inc.php │ ├── zabbix.php │ └── zabbix_chart.php ├── big_graph.php ├── graph.php ├── left.php ├── page.class.php ├── screenshots │ ├── 1.jpg │ ├── 2.jpg │ └── 3.jpg ├── static │ ├── blank.gif │ ├── fancybox_buttons.png │ ├── fancybox_loading.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── jquery-1.4.4.min.js │ ├── jquery-2.0.3.min.js │ ├── jquery.fancybox.min.css │ ├── jquery.fancybox.min.js │ ├── jquery.ztree.core-3.5.js │ ├── line_conn.gif │ ├── loading.gif │ ├── page.css │ ├── zTreeStandard.gif │ ├── zTreeStandard.png │ ├── zTreeStyle.css │ └── ztreedemo.css ├── zabbix.php ├── zabbix_ajax.php └── zabbix_config.php ├── zabbix-2.4.5 ├── README.md └── zatree-zabbix-2.4.5.tar.gz └── zabbix-3.0.x ├── README.md ├── images └── install.jpg ├── start.sh └── zatree.tar.gz /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Zatree简介 2 | ================================== 3 | 4 | 当zabbix走进千家万户的时候,我们也许需要做点什么。 5 | 6 | zatree是监控软件zabbix的一个插件,主要功能是提供host group的树形展示和在item里指定关键字查询及数据排序。 7 | 8 | 安装方法进到不同版本目录看readme 9 | 10 | 11 | 屏幕截图 12 | ================================== 13 | 14 | zatree首页 15 | 16 | ![image](https://raw.github.com/spide4k/zatree/master/zabbix-2.0.x/screenshots/1.jpg) 17 | 18 | 单个图像放大 19 | 20 | ![image](https://raw.github.com/spide4k/zatree/master/zabbix-2.0.x/screenshots/2.jpg) 21 | -------------------------------------------------------------------------------- /zabbix-2.0.x/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /zabbix-2.0.x/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/WdatePicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 Beta3 3 | * License: http://www.my97.net/dp/license.asp 4 | */ 5 | var $dp,WdatePicker;(function(){var $={ 6 | $langList:[ 7 | {name:"en",charset:"UTF-8"}, 8 | {name:"zh-cn",charset:"UTF-8"}, 9 | {name:"zh-tw",charset:"UTF-8"}], 10 | $skinList:[ 11 | {name:"default",charset:"gb2312"}, 12 | {name:"whyGreen",charset:"gb2312"}, 13 | {name:"blue",charset:"gb2312"}, 14 | {name:"ext",charset:"gb2312"}, 15 | {name:"twoer",charset:"gb2312"}], 16 | $wdate:true, 17 | $crossFrame:true, 18 | $preLoad:false, 19 | $dpPath:"", 20 | doubleCalendar:false, 21 | enableKeyboard:true, 22 | enableInputMask:true, 23 | autoUpdateOnChanged:null, 24 | weekMethod:"ISO8601", 25 | position:{}, 26 | lang:"auto", 27 | skin:"default", 28 | dateFmt:"yyyy-MM-dd", 29 | realDateFmt:"yyyy-MM-dd", 30 | realTimeFmt:"HH:mm:ss", 31 | realFullFmt:"%Date %Time", 32 | minDate:"1900-01-01 00:00:00", 33 | maxDate:"2099-12-31 23:59:59", 34 | startDate:"", 35 | alwaysUseStartDate:false, 36 | yearOffset:1911, 37 | firstDayOfWeek:0, 38 | isShowWeek:false, 39 | highLineWeekDay:true, 40 | isShowClear:true, 41 | isShowToday:true, 42 | isShowOK:true, 43 | isShowOthers:true, 44 | readOnly:false, 45 | errDealMode:0, 46 | autoPickDate:null, 47 | qsEnabled:true, 48 | autoShowQS:false, 49 | 50 | specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,elProp:"",errMsg:"",quickSel:[],has:{},getRealLang:function(){var _=$.$langList;for(var A=0;A<_.length;A++)if(_[A].name==this.lang)return _[A];return _[0]}};WdatePicker=T;var X=window,S={innerHTML:""},M="document",H="documentElement",C="getElementsByTagName",U,A,R,G,a,W=navigator.appName;if(W=="Microsoft Internet Explorer")R=true;else if(W=="Opera")a=true;else G=true;A=$.$dpPath||J();if($.$wdate)K(A+"skin/WdatePicker.css");U=X;if($.$crossFrame){try{while(U.parent!=U&&U.parent[M][C]("frameset").length==0)U=U.parent}catch(N){}}if(!U.$dp)U.$dp={ff:G,ie:R,opera:a,status:0,defMinDate:$.minDate,defMaxDate:$.maxDate};B();if($.$preLoad&&$dp.status==0)E(X,"onload",function(){T(null,true)});if(!X[M].docMD){E(X[M],"onmousedown",D);X[M].docMD=true}if(!U[M].docMD){E(U[M],"onmousedown",D);U[M].docMD=true}E(X,"onunload",function(){if($dp.dd)O($dp.dd,"none")});function B(){try{U[M],U.$dp=U.$dp||{}}catch($){U=X;$dp=$dp||{}}var A={win:X,$:function($){return(typeof $=="string")?X[M].getElementById($):$},$D:function($,_){return this.$DV(this.$($).value,_)},$DV:function(_,$){if(_!=""){this.dt=$dp.cal.splitDate(_,$dp.cal.dateFmt);if($)for(var B in $)if(this.dt[B]===undefined)this.errMsg="invalid property:"+B;else{this.dt[B]+=$[B];if(B=="M"){var C=$["M"]>0?1:0,A=new Date(this.dt["y"],this.dt["M"],0).getDate();this.dt["d"]=Math.min(A+C,this.dt["d"])}}if(this.dt.refresh())return this.dt}return""},show:function(){var A=U[M].getElementsByTagName("div"),$=100000;for(var B=0;B$)$=_}this.dd.style.zIndex=$+2;O(this.dd,"block")},hide:function(){O(this.dd,"none")},attachEvent:E};for(var _ in A)U.$dp[_]=A[_];$dp=U.$dp}function E(A,$,_){if(R)A.attachEvent($,_);else if(_){var B=$.replace(/on/,"");_._ieEmuEventHandler=function($){return _($)};A.addEventListener(B,_._ieEmuEventHandler,false)}}function J(){var _,A,$=X[M][C]("script");for(var B=0;B<$.length;B++){_=$[B].getAttribute("src")||"";_=_.substr(0,_.toLowerCase().indexOf("wdatepicker.js"));A=_.lastIndexOf("/");if(A>0)_=_.substring(0,A+1);if(_)break}return _}function K(A,$,B){var D=X[M][C]("HEAD").item(0),_=X[M].createElement("link");if(D){_.href=A;_.rel="stylesheet";_.type="text/css";if($)_.title=$;if(B)_.charset=B;D.appendChild(_)}}function F($){$=$||U;var A=0,_=0;while($!=U){var D=$.parent[M][C]("iframe");for(var F=0;F_.scrollTop||A.scrollLeft>_.scrollLeft))?A:_;return{"top":B.scrollTop,"left":B.scrollLeft}}function D($){try{var _=$?($.srcElement||$.target):null;if($dp.cal&&!$dp.eCont&&$dp.dd&&_!=$dp.el&&$dp.dd.style.display=="block")$dp.cal.close()}catch($){}}function Y(){$dp.status=2}var P,_;function T(N,F){if(!$dp)return;B();N=N||{};for(var K in $)if(K.substring(0,1)!="$"&&N[K]===undefined)N[K]=$[K];if(F){if(!L()){_=_||setInterval(function(){if(U[M].readyState=="complete")clearInterval(_);T(null,true)},50);return}if($dp.status==0){$dp.status=1;N.el=S;I(N,true)}else return}else if(N.eCont){N.eCont=$dp.$(N.eCont);N.el=S;N.autoPickDate=true;N.qsEnabled=false;I(N)}else{if($.$preLoad&&$dp.status!=2)return;var J=H();if(X.event===J||J){N.srcEl=J.srcElement||J.target;J.cancelBubble=true}N.el=N.el=$dp.$(N.el||N.srcEl);if(!N.el||N.el["My97Mark"]===true||N.el.disabled||($dp.dd&&O($dp.dd)!="none"&&$dp.dd.style.left!="-970px")){try{if(N.el["My97Mark"])N.el["My97Mark"]=false}catch(C){}return}if(J&&N.el.nodeType==1&&N.el["My97Mark"]===undefined){var A,D;if(J.type=="focus")E(N.el,"onclick",function(){T(N)});else E(N.el,"onfocus",function(){T(N)})}I(N)}function L(){if(R&&U!=X&&U[M].readyState!="complete")return false;return true}function H(){if(G){func=H.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexOf("Event")>=0)return $;func=func.caller}return null}return event}}function Q(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function O(_,$){if(_)if($!=null)_.style.display=$;else return Q(_,"display")}function I(G,_){var D=G.el?G.el.nodeName:"INPUT";if(_||G.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(D))G.elProp=D=="INPUT"?"value":"innerHTML";else return;if(G.lang=="auto")G.lang=R?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase();if(!G.eCont)for(var C in G)$dp[C]=G[C];if(!$dp.dd||G.eCont||($dp.dd&&(G.getRealLang().name!=$dp.dd.lang||G.skin!=$dp.dd.skin))){if(G.eCont)E(G.eCont,G);else{$dp.dd=U[M].createElement("DIV");$dp.dd.style.cssText="position:absolute";U[M].body.appendChild($dp.dd);E($dp.dd,G);if(_)$dp.dd.style.left=$dp.dd.style.top="-970px";else{$dp.show();B($dp)}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont)B($dp)}function E(I,H){var G=X[M].domain,E=false;I.innerHTML="";var _=$.$langList,C=$.$skinList,F;try{F=I.lastChild.contentWindow[M]}catch(D){E=true;I.lastChild.src="javascript:void((function(){document.open();document.domain='"+G+"';})())";F=I.lastChild.contentWindow[M]}var K=H.getRealLang();I.lang=K.name;I.skin=H.skin;var J=[""];if(E)J[1]="document.domain=\""+G+"\";";for(var L=0;L");J.push("");J.push("");J.push("");H.setPos=B;H.onload=Y;F.write("");F.cfg=H;F.write(J.join(""));F.close()}function B(J){var H=J.position.left,C=J.position.top,D=J.el;if(D==S)return;if(D!=J.srcEl&&(O(D)=="none"||D.type=="hidden"))D=J.srcEl;var I=V(D),$=F(X),E=L(U),B=Z(U),G=$dp.dd.offsetHeight,A=$dp.dd.offsetWidth;if(isNaN(C))C=0;if(($.topM+I.bottom+G>E.height)&&($.topM+I.top-G>0))C+=B.top+$.topM+I.top-G-2;else{C+=B.top+$.topM+I.bottom;var _=C-B.top+G-E.height;if(_>0)C-=_}if(isNaN(H))H=0;H+=B.left+Math.min($.leftM+I.left,E.width-A-5)-(R?2:0);J.dd.style.top=C+"px";J.dd.style.left=H+"px"}}})() -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/lang/en.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "Invalid date or the date out of range,redo or not?", 3 | aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 4 | aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], 5 | aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 6 | aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], 7 | clearStr: "Clear", 8 | todayStr: "Today", 9 | okStr: "OK", 10 | updateStr: "OK", 11 | timeStr: "Time", 12 | quickStr: "Quick Selection", 13 | err_1: 'MinDate Cannot be bigger than MaxDate!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u786E\u5B9A", 10 | updateStr: "\u786E\u5B9A", 11 | timeStr: "\u65F6\u95F4", 12 | quickStr: "\u5FEB\u901F\u9009\u62E9", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/lang/zh-tw.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u78BA\u5B9A", 10 | updateStr: "\u78BA\u5B9A", 11 | timeStr: "\u6642\u9593", 12 | quickStr: "\u5FEB\u901F\u9078\u64C7", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/WdatePicker.css: -------------------------------------------------------------------------------- 1 | .Wdate{ 2 | border:#999 1px solid; 3 | height:20px; 4 | background:#fff url(datePicker.gif) no-repeat right; 5 | } 6 | 7 | .WdateFmtErr{ 8 | font-weight:bold; 9 | color:red; 10 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/datePicker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/My97DatePicker/skin/datePicker.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/default/datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 3 | */ 4 | 5 | .WdateDiv{ 6 | width:180px; 7 | background-color:#FFFFFF; 8 | border:#bbb 1px solid; 9 | padding:2px; 10 | } 11 | 12 | .WdateDiv2{ 13 | width:360px; 14 | } 15 | .WdateDiv *{font-size:9pt;} 16 | 17 | .WdateDiv .NavImg a{ 18 | display:block; 19 | cursor:pointer; 20 | height:16px; 21 | width:16px; 22 | } 23 | 24 | .WdateDiv .NavImgll a{ 25 | float:left; 26 | background:transparent url(img.gif) no-repeat scroll 0 0; 27 | } 28 | .WdateDiv .NavImgl a{ 29 | float:left; 30 | background:transparent url(img.gif) no-repeat scroll -16px 0; 31 | } 32 | .WdateDiv .NavImgr a{ 33 | float:right; 34 | background:transparent url(img.gif) no-repeat scroll -32px 0; 35 | } 36 | .WdateDiv .NavImgrr a{ 37 | float:right; 38 | background:transparent url(img.gif) no-repeat scroll -48px 0; 39 | } 40 | 41 | .WdateDiv #dpTitle{ 42 | height:24px; 43 | margin-bottom:2px; 44 | padding:1px; 45 | } 46 | 47 | .WdateDiv .yminput{ 48 | margin-top:2px; 49 | text-align:center; 50 | height:20px; 51 | border:0px; 52 | width:50px; 53 | cursor:pointer; 54 | } 55 | 56 | .WdateDiv .yminputfocus{ 57 | margin-top:2px; 58 | text-align:center; 59 | font-weight:bold; 60 | height:20px; 61 | color:blue; 62 | border:#ccc 1px solid; 63 | width:50px; 64 | } 65 | 66 | .WdateDiv .menuSel{ 67 | z-index:1; 68 | position:absolute; 69 | background-color:#FFFFFF; 70 | border:#ccc 1px solid; 71 | display:none; 72 | } 73 | 74 | .WdateDiv .menu{ 75 | cursor:pointer; 76 | background-color:#fff; 77 | } 78 | 79 | .WdateDiv .menuOn{ 80 | cursor:pointer; 81 | background-color:#BEEBEE; 82 | } 83 | 84 | .WdateDiv .invalidMenu{ 85 | color:#aaa; 86 | } 87 | 88 | .WdateDiv .YMenu{ 89 | margin-top:20px; 90 | 91 | } 92 | 93 | .WdateDiv .MMenu{ 94 | margin-top:20px; 95 | *width:62px; 96 | } 97 | 98 | .WdateDiv .hhMenu{ 99 | margin-top:-90px; 100 | margin-left:26px; 101 | } 102 | 103 | .WdateDiv .mmMenu{ 104 | margin-top:-46px; 105 | margin-left:26px; 106 | } 107 | 108 | .WdateDiv .ssMenu{ 109 | margin-top:-24px; 110 | margin-left:26px; 111 | } 112 | 113 | .WdateDiv .Wweek { 114 | text-align:center; 115 | background:#DAF3F5; 116 | border-right:#BDEBEE 1px solid; 117 | } 118 | 119 | .WdateDiv .MTitle{ 120 | background-color:#BDEBEE; 121 | } 122 | .WdateDiv .WdayTable2{ 123 | border-collapse:collapse; 124 | border:#c5d9e8 1px solid; 125 | } 126 | .WdateDiv .WdayTable2 table{ 127 | border:0; 128 | } 129 | 130 | .WdateDiv .WdayTable{ 131 | line-height:20px; 132 | border:#c5d9e8 1px solid; 133 | } 134 | .WdateDiv .WdayTable td{ 135 | text-align:center; 136 | } 137 | 138 | .WdateDiv .Wday{ 139 | cursor:pointer; 140 | } 141 | 142 | .WdateDiv .WdayOn{ 143 | cursor:pointer; 144 | background-color:#C0EBEF; 145 | } 146 | 147 | .WdateDiv .Wwday{ 148 | cursor:pointer; 149 | color:#FF2F2F; 150 | } 151 | 152 | .WdateDiv .WwdayOn{ 153 | cursor:pointer; 154 | color:#000; 155 | background-color:#C0EBEF; 156 | } 157 | .WdateDiv .Wtoday{ 158 | cursor:pointer; 159 | color:blue; 160 | } 161 | .WdateDiv .Wselday{ 162 | background-color:#A9E4E9; 163 | } 164 | .WdateDiv .WspecialDay{ 165 | background-color:#66F4DF; 166 | } 167 | 168 | .WdateDiv .WotherDay{ 169 | cursor:pointer; 170 | color:#6A6AFF; 171 | } 172 | 173 | .WdateDiv .WotherDayOn{ 174 | cursor:pointer; 175 | background-color:#C0EBEF; 176 | } 177 | 178 | .WdateDiv .WinvalidDay{ 179 | color:#aaa; 180 | } 181 | 182 | .WdateDiv #dpTime{ 183 | float:left; 184 | margin-top:3px; 185 | margin-right:30px; 186 | } 187 | 188 | .WdateDiv #dpTime #dpTimeStr{ 189 | margin-left:1px; 190 | } 191 | 192 | .WdateDiv #dpTime input{ 193 | width:18px; 194 | height:20px; 195 | text-align:center; 196 | border:#ccc 1px solid; 197 | } 198 | 199 | .WdateDiv #dpTime .tB{ 200 | border-right:0px; 201 | } 202 | 203 | .WdateDiv #dpTime .tE{ 204 | border-left:0; 205 | border-right:0; 206 | } 207 | 208 | .WdateDiv #dpTime .tm{ 209 | width:7px; 210 | border-left:0; 211 | border-right:0; 212 | } 213 | 214 | .WdateDiv #dpTime #dpTimeUp{ 215 | height:10px; 216 | width:13px; 217 | border:0px; 218 | background:url(img.gif) no-repeat -32px -16px; 219 | } 220 | 221 | .WdateDiv #dpTime #dpTimeDown{ 222 | height:10px; 223 | width:13px; 224 | border:0px; 225 | background:url(img.gif) no-repeat -48px -16px; 226 | } 227 | 228 | .WdateDiv #dpQS { 229 | float:left; 230 | margin-right:3px; 231 | margin-top:3px; 232 | background:url(img.gif) no-repeat 0px -16px; 233 | width:20px; 234 | height:20px; 235 | cursor:pointer; 236 | } 237 | .WdateDiv #dpControl { 238 | text-align:right; 239 | } 240 | .WdateDiv .dpButton{ 241 | height:20px; 242 | width:45px; 243 | border:#ccc 1px solid; 244 | margin-top:2px; 245 | margin-right:1px; 246 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/default/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/My97DatePicker/skin/default/img.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/whyGreen/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/My97DatePicker/skin/whyGreen/bg.jpg -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/whyGreen/datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 Skin:whyGreen 3 | */ 4 | .WdateDiv{ 5 | width:180px; 6 | background-color:#fff; 7 | border:#C5E1E4 1px solid; 8 | padding:2px; 9 | } 10 | 11 | .WdateDiv2{ 12 | width:360px; 13 | } 14 | .WdateDiv *{font-size:9pt;} 15 | 16 | .WdateDiv .NavImg a{ 17 | cursor:pointer; 18 | display:block; 19 | width:16px; 20 | height:16px; 21 | margin-top:1px; 22 | } 23 | 24 | .WdateDiv .NavImgll a{ 25 | float:left; 26 | background:url(img.gif) no-repeat; 27 | } 28 | .WdateDiv .NavImgl a{ 29 | float:left; 30 | background:url(img.gif) no-repeat -16px 0px; 31 | } 32 | .WdateDiv .NavImgr a{ 33 | float:right; 34 | background:url(img.gif) no-repeat -32px 0px; 35 | } 36 | .WdateDiv .NavImgrr a{ 37 | float:right; 38 | background:url(img.gif) no-repeat -48px 0px; 39 | } 40 | 41 | .WdateDiv #dpTitle{ 42 | height:24px; 43 | padding:1px; 44 | border:#c5d9e8 1px solid; 45 | background:url(bg.jpg); 46 | margin-bottom:2px; 47 | } 48 | 49 | .WdateDiv .yminput{ 50 | margin-top:2px; 51 | text-align:center; 52 | border:0px; 53 | height:20px; 54 | width:50px; 55 | color:#034c50; 56 | background-color:transparent; 57 | cursor:pointer; 58 | } 59 | 60 | .WdateDiv .yminputfocus{ 61 | margin-top:2px; 62 | text-align:center; 63 | border:#939393 1px solid; 64 | font-weight:bold; 65 | color:#034c50; 66 | height:20px; 67 | width:50px; 68 | } 69 | 70 | .WdateDiv .menuSel{ 71 | z-index:1; 72 | position:absolute; 73 | background-color:#FFFFFF; 74 | border:#A3C6C8 1px solid; 75 | display:none; 76 | } 77 | 78 | .WdateDiv .menu{ 79 | cursor:pointer; 80 | background-color:#fff; 81 | color:#11777C; 82 | } 83 | 84 | .WdateDiv .menuOn{ 85 | cursor:pointer; 86 | background-color:#BEEBEE; 87 | } 88 | 89 | .WdateDiv .invalidMenu{ 90 | color:#aaa; 91 | } 92 | 93 | .WdateDiv .YMenu{ 94 | margin-top:20px; 95 | } 96 | 97 | .WdateDiv .MMenu{ 98 | margin-top:20px; 99 | *width:62px; 100 | } 101 | 102 | .WdateDiv .hhMenu{ 103 | margin-top:-90px; 104 | margin-left:26px; 105 | } 106 | 107 | .WdateDiv .mmMenu{ 108 | margin-top:-46px; 109 | margin-left:26px; 110 | } 111 | 112 | .WdateDiv .ssMenu{ 113 | margin-top:-24px; 114 | margin-left:26px; 115 | } 116 | 117 | .WdateDiv .Wweek { 118 | text-align:center; 119 | background:#DAF3F5; 120 | border-right:#BDEBEE 1px solid; 121 | } 122 | 123 | .WdateDiv .MTitle{ 124 | color:#13777e; 125 | background-color:#bdebee; 126 | } 127 | .WdateDiv .WdayTable2{ 128 | border-collapse:collapse; 129 | border:#BEE9F0 1px solid; 130 | } 131 | .WdateDiv .WdayTable2 table{ 132 | border:0; 133 | } 134 | 135 | .WdateDiv .WdayTable{ 136 | line-height:20px; 137 | color:#13777e; 138 | background-color:#edfbfb; 139 | border:#BEE9F0 1px solid; 140 | } 141 | .WdateDiv .WdayTable td{ 142 | text-align:center; 143 | } 144 | 145 | .WdateDiv .Wday{ 146 | cursor:pointer; 147 | } 148 | 149 | .WdateDiv .WdayOn{ 150 | cursor:pointer; 151 | background-color:#74d2d9 ; 152 | } 153 | 154 | .WdateDiv .Wwday{ 155 | cursor:pointer; 156 | color:#ab1e1e; 157 | } 158 | 159 | .WdateDiv .WwdayOn{ 160 | cursor:pointer; 161 | background-color:#74d2d9; 162 | } 163 | .WdateDiv .Wtoday{ 164 | cursor:pointer; 165 | color:blue; 166 | } 167 | .WdateDiv .Wselday{ 168 | background-color:#A7E2E7; 169 | } 170 | .WdateDiv .WspecialDay{ 171 | background-color:#66F4DF; 172 | } 173 | 174 | .WdateDiv .WotherDay{ 175 | cursor:pointer; 176 | color:#0099CC; 177 | } 178 | 179 | .WdateDiv .WotherDayOn{ 180 | cursor:pointer; 181 | background-color:#C0EBEF; 182 | } 183 | 184 | .WdateDiv .WinvalidDay{ 185 | color:#aaa; 186 | } 187 | 188 | .WdateDiv #dpTime{ 189 | float:left; 190 | margin-top:3px; 191 | margin-right:30px; 192 | } 193 | 194 | .WdateDiv #dpTime #dpTimeStr{ 195 | margin-left:1px; 196 | color:#497F7F; 197 | } 198 | 199 | .WdateDiv #dpTime input{ 200 | height:20px; 201 | width:18px; 202 | text-align:center; 203 | color:#333; 204 | border:#61CAD0 1px solid; 205 | } 206 | 207 | .WdateDiv #dpTime .tB{ 208 | border-right:0px; 209 | } 210 | 211 | .WdateDiv #dpTime .tE{ 212 | border-left:0; 213 | border-right:0; 214 | } 215 | 216 | .WdateDiv #dpTime .tm{ 217 | width:7px; 218 | border-left:0; 219 | border-right:0; 220 | } 221 | 222 | .WdateDiv #dpTime #dpTimeUp{ 223 | height:10px; 224 | width:13px; 225 | border:0px; 226 | background:url(img.gif) no-repeat -32px -16px; 227 | } 228 | 229 | .WdateDiv #dpTime #dpTimeDown{ 230 | height:10px; 231 | width:13px; 232 | border:0px; 233 | background:url(img.gif) no-repeat -48px -16px; 234 | } 235 | 236 | .WdateDiv #dpQS { 237 | float:left; 238 | margin-right:3px; 239 | margin-top:3px; 240 | background:url(img.gif) no-repeat 0px -16px; 241 | width:20px; 242 | height:20px; 243 | cursor:pointer; 244 | } 245 | .WdateDiv #dpControl { 246 | text-align:right; 247 | margin-top:3px; 248 | } 249 | .WdateDiv .dpButton{ 250 | height:20px; 251 | width:45px; 252 | margin-top:2px; 253 | border:#38B1B9 1px solid; 254 | background-color:#CFEBEE; 255 | color:#08575B; 256 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/My97DatePicker/skin/whyGreen/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/My97DatePicker/skin/whyGreen/img.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/README.md -------------------------------------------------------------------------------- /zabbix-2.0.x/ZabbixApi.class.php: -------------------------------------------------------------------------------- 1 | . 22 | * 23 | * @copyright GNU General Public License 24 | * @author confirm IT solutions GmbH, Rathausstrase 14, CH-6340 Baar 25 | * 26 | * @version $Id: ZabbixApi.class.php 138 2012-10-08 08:00:24Z dbarton $ 27 | */ 28 | 29 | /** 30 | * @brief Concrete class for the Zabbix API. 31 | */ 32 | require_once("ZabbixApiAbstract.class.php"); 33 | class ZabbixApi extends ZabbixApiAbstract 34 | { 35 | 36 | } 37 | 38 | ?> 39 | -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/CItemValue.php: -------------------------------------------------------------------------------- 1 | -1) { 62 | $real_item['history'] = ZBX_HISTORY_DATA_UPKEEP; 63 | } 64 | 65 | if (($real_item['history'] * SEC_PER_DAY) > (time() - ($from_time + $period / 2)) // should pick data from history or trends 66 | && ($period / $sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL)) { // is reasonable to take data from history? 67 | //$this->dataFrom = 'history'; 68 | array_push($sql_arr, 'SELECT itemid,' . $calc_field . ' AS i,' . 69 | 'COUNT(*) AS count,AVG(value) AS avg,MIN(value) as min,' . 70 | 'MAX(value) AS max,MAX(clock) AS clock' . 71 | ' FROM history ' . 72 | ' WHERE itemid=' . $itemInfo['itemid'] . 73 | ' AND clock>=' . $from_time . 74 | ' AND clock<=' . $to_time . 75 | ' GROUP BY itemid,' . $calc_field 76 | , 'SELECT itemid,' . $calc_field . ' AS i,' . 77 | 'COUNT(*) AS count,AVG(value) AS avg,MIN(value) AS min,' . 78 | 'MAX(value) AS max,MAX(clock) AS clock' . 79 | ' FROM history_uint ' . 80 | ' WHERE itemid=' . $itemInfo['itemid'] . 81 | ' AND clock>=' . $from_time . 82 | ' AND clock<=' . $to_time . 83 | ' GROUP BY itemid,' . $calc_field 84 | ); 85 | } else { 86 | //$this->dataFrom = 'trends'; 87 | array_push($sql_arr, 'SELECT itemid,' . $calc_field . ' AS i,' . 88 | 'SUM(num) AS count,AVG(value_avg) AS avg,MIN(value_min) AS min,' . 89 | 'MAX(value_max) AS max,MAX(clock) AS clock' . 90 | ' FROM trends' . 91 | ' WHERE itemid=' . $itemInfo['itemid'] . 92 | ' AND clock>=' . $from_time . 93 | ' AND clock<=' . $to_time . 94 | ' GROUP BY itemid,' . $calc_field 95 | , 'SELECT itemid,' . $calc_field . ' AS i,' . 96 | 'SUM(num) AS count,AVG(value_avg) AS avg,MIN(value_min) AS min,' . 97 | 'MAX(value_max) AS max,MAX(clock) AS clock' . 98 | ' FROM trends_uint ' . 99 | ' WHERE itemid=' . $itemInfo['itemid'] . 100 | ' AND clock>=' . $from_time . 101 | ' AND clock<=' . $to_time . 102 | ' GROUP BY itemid,' . $calc_field 103 | ); 104 | 105 | $itemInfo['delay'] = max($itemInfo['delay'], SEC_PER_HOUR); 106 | } 107 | 108 | $curr_data['count'] = null; 109 | $curr_data['min'] = null; 110 | $curr_data['max'] = null; 111 | $curr_data['avg'] = null; 112 | $curr_data['clock'] = null; 113 | 114 | foreach ($sql_arr as $sql) { 115 | 116 | $result = DBselect($sql); 117 | while ($row = DBfetch($result)) { 118 | $idx = $row['i'] - 1; 119 | if ($idx < 0) { 120 | continue; 121 | } 122 | 123 | 124 | $curr_data['count'][$idx] = $row['count']; 125 | $curr_data['min'][$idx] = $row['min']; 126 | $curr_data['max'][$idx] = $row['max']; 127 | $curr_data['avg'][$idx] = $row['avg']; 128 | $curr_data['clock'][$idx] = $row['clock']; 129 | $curr_data['shift_min'][$idx] = 0; 130 | $curr_data['shift_max'][$idx] = 0; 131 | $curr_data['shift_avg'][$idx] = 0; 132 | } 133 | unset($row); 134 | } 135 | $curr_data['avg_orig'] = is_array($curr_data['avg']) ? zbx_avg($curr_data['avg']) : null; 136 | 137 | return $curr_data; 138 | } 139 | 140 | public function getLastValueBy($data) { 141 | //$data = &$this->newData[$item['itemid']][$item['calc_type']]; 142 | if (isset($data)) { 143 | for ($i = 286 - 1; $i >= 0; $i--) { 144 | if (!empty($data['count'][$i])) { 145 | switch ($item['calc_fnc']) { 146 | case CALC_FNC_MIN: 147 | return $data['min'][$i]; 148 | case CALC_FNC_MAX: 149 | return $data['max'][$i]; 150 | case CALC_FNC_ALL: 151 | case CALC_FNC_AVG: 152 | default: 153 | return $data['avg'][$i]; 154 | } 155 | } 156 | } 157 | } 158 | return 0; 159 | } 160 | 161 | public function getItemListFormat($list = array()) { 162 | $itemList = $list['list_item']; 163 | 164 | $parame = $list['parame']; 165 | 166 | $search_key = $parame['item_name_search']; 167 | 168 | $order_result_list = array(); 169 | 170 | $search = 0; 171 | if(empty($search_key)){ 172 | $search_key_list = array(); 173 | }else{ 174 | $search_key_list = explode(",", $search_key); 175 | } 176 | 177 | if (count($search_key_list) >= 1) { 178 | $search = 1; 179 | } 180 | 181 | foreach ($itemList as $each_item) { 182 | $each_item = (array) $each_item; 183 | 184 | $item = get_item_by_itemid($each_item['itemid']); 185 | 186 | $newItem = $item; 187 | $newItem['name'] = itemName($item); 188 | $newItem['delay'] = getItemDelay($item['delay'], $item['delay_flex']); 189 | 190 | $host = get_host_by_hostid($item['hostid']); 191 | 192 | $newItem['hostname'] = $host['name']; 193 | 194 | if (strpos($item['units'], ',') !== false) { 195 | list($newItem['units'], $newItem['unitsLong']) = explode(',', $item['units']); 196 | } else { 197 | $newItem['unitsLong'] = ''; 198 | } 199 | 200 | if ($search == 0) { 201 | $newItem['graphid'] = $each_item['graphid']; 202 | $order_result_list[$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => 0, 'min' => 0, 'avg' => 0, 'max' => 0, 'hostname' => $newItem['hostname'],'chazhi'=>0); 203 | } else { 204 | 205 | foreach ($search_key_list as $each_search_key) { 206 | $each_search_key=trim($each_search_key); 207 | //按关键字进行筛选 208 | if (strpos(strtolower($newItem['name']), strtolower($each_search_key)) === false) { 209 | 210 | } else { 211 | $newItem['calc_fnc'] = is_null($each_item['calc_fnc']) ? CALC_FNC_AVG : $each_item->calc_fnc; 212 | $newItem['calc_type'] = GRAPH_ITEM_SIMPLE; 213 | $newItem['graphid'] = $each_item['graphid']; 214 | 215 | $item_info_new = array_merge($newItem, $parame); 216 | 217 | $data = self::GetItemValues($item_info_new); 218 | 219 | if (isset($data) && isset($data['min'])) { 220 | 221 | $lastvalue = convert_units(self::getLastValueBy($data), $newItem['units'], ITEM_CONVERT_NO_UNITS); 222 | $min = convert_units(min($data['min']), $newItem['units'], ITEM_CONVERT_NO_UNITS); 223 | $avg = convert_units($data['avg_orig'], $newItem['units'], ITEM_CONVERT_NO_UNITS); 224 | $max = convert_units(max($data['max']), $newItem['units'], ITEM_CONVERT_NO_UNITS); 225 | //return array("lastvalue"=>$lastvalue,'min'=>$min,'avg'=>$avg,'max'=>$max); 226 | $order_result_list[$each_search_key][$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => self::getLastValueBy($data), 'min' => min($data['min']), 'avg' => $data['avg_orig'], 'max' => max($data['max']), 'hostname' => $newItem['hostname'],'chazhi'=>max($data['max'])-min($data['min'])); 227 | } else { 228 | $order_result_list[$each_search_key][$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => 0, 'min' => 0, 'avg' => 0, 'max' => 0, 'hostname' => $newItem['hostname'],'chazhi'=>0); 229 | } 230 | break; 231 | } 232 | } 233 | } 234 | } 235 | 236 | return $order_result_list; 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/class.cchart_zabbix.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/addfile/class.cchart_zabbix.php -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/class.cgraphdraw_zabbix.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/addfile/class.cgraphdraw_zabbix.php -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/class.cimagetexttable_zabbix.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/addfile/class.cimagetexttable_zabbix.php -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/zabbix.php: -------------------------------------------------------------------------------- 1 | checkAuthentication($_COOKIE['zbx_sessionid']); 15 | 16 | if($date['alias']=='guest'){ 17 | header ( "Location:/zabbix/" ); 18 | }else{ 19 | require_once dirname(__FILE__).'/zatree/zabbix.php'; 20 | } 21 | }else{ 22 | header ( "Location:/zabbix/" ); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /zabbix-2.0.x/addfile/zabbix_chart.php: -------------------------------------------------------------------------------- 1 | array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 32 | 'screenid' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 33 | 'period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 34 | 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 35 | 'profileIdx' => array(T_ZBX_STR, O_OPT, null, null, null), 36 | 'profileIdx2' => array(T_ZBX_STR, O_OPT, null, null, null), 37 | 'updateProfile' => array(T_ZBX_STR, O_OPT, null, null, null), 38 | 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 39 | 'width' => array(T_ZBX_INT, O_OPT, P_NZERO, '{}>0', null), 40 | 'height' => array(T_ZBX_INT, O_OPT, P_NZERO, '{}>0', null) 41 | ); 42 | check_fields($fields); 43 | 44 | /* 45 | * Permissions 46 | */ 47 | if (!DBfetch(DBselect('SELECT g.graphid FROM graphs g WHERE g.graphid='.$_REQUEST['graphid']))) { 48 | show_error_message(_('No graphs defined.')); 49 | } 50 | 51 | $dbGraph = API::Graph()->get(array( 52 | 'nodeids' => get_current_nodeid(true), 53 | 'graphids' => $_REQUEST['graphid'], 54 | 'output' => API_OUTPUT_EXTEND 55 | )); 56 | if (empty($dbGraph)) { 57 | access_deny(); 58 | } 59 | else { 60 | $dbGraph = reset($dbGraph); 61 | } 62 | 63 | $host = API::Host()->get(array( 64 | 'nodeids' => get_current_nodeid(true), 65 | 'graphids' => $_REQUEST['graphid'], 66 | 'output' => API_OUTPUT_EXTEND, 67 | 'templated_hosts' => true 68 | )); 69 | $host = reset($host); 70 | 71 | /* 72 | * Display 73 | */ 74 | $timeline = CScreenBase::calculateTime(array( 75 | 'profileIdx' => get_request('profileIdx', 'web.screens'), 76 | 'profileIdx2' => get_request('profileIdx2'), 77 | 'updateProfile' => get_request('updateProfile', true), 78 | 'period' => get_request('period'), 79 | 'stime' => get_request('stime') 80 | )); 81 | 82 | CProfile::update('web.screens.graphid', $_REQUEST['graphid'], PROFILE_TYPE_ID); 83 | 84 | $chartHeader = ''; 85 | if (id2nodeid($dbGraph['graphid']) != get_current_nodeid()) { 86 | $chartHeader = get_node_name_by_elid($dbGraph['graphid'], true, ': '); 87 | } 88 | $chartHeader .= $host['name'].': '.$dbGraph['name']; 89 | 90 | $graph = new CChart_Zabbix($dbGraph['graphtype']); 91 | $graph->setHeader($chartHeader); 92 | $graph->setPeriod($timeline['period']); 93 | $graph->setSTime($timeline['stime']); 94 | 95 | if (isset($_REQUEST['border'])) { 96 | $graph->setBorder(0); 97 | } 98 | 99 | $width = get_request('width', 0); 100 | if ($width <= 0) { 101 | $width = $dbGraph['width']; 102 | } 103 | 104 | $height = get_request('height', 0); 105 | if ($height <= 0) { 106 | $height = $dbGraph['height']; 107 | } 108 | 109 | $graph->showLegend($dbGraph['show_legend']); 110 | $graph->showWorkPeriod($dbGraph['show_work_period']); 111 | $graph->showTriggers($dbGraph['show_triggers']); 112 | $graph->setWidth($width); 113 | $graph->setHeight($height); 114 | $graph->setYMinAxisType($dbGraph['ymin_type']); 115 | $graph->setYMaxAxisType($dbGraph['ymax_type']); 116 | $graph->setYAxisMin($dbGraph['yaxismin']); 117 | $graph->setYAxisMax($dbGraph['yaxismax']); 118 | $graph->setYMinItemId($dbGraph['ymin_itemid']); 119 | $graph->setYMaxItemId($dbGraph['ymax_itemid']); 120 | $graph->setLeftPercentage($dbGraph['percent_left']); 121 | $graph->setRightPercentage($dbGraph['percent_right']); 122 | 123 | $dbGraphItems = DBselect( 124 | 'SELECT gi.*'. 125 | ' FROM graphs_items gi'. 126 | ' WHERE gi.graphid='.$dbGraph['graphid']. 127 | ' ORDER BY gi.sortorder, gi.itemid DESC' 128 | ); 129 | while ($dbGraphItem = DBfetch($dbGraphItems)) { 130 | $graph->addItem( 131 | $dbGraphItem['itemid'], 132 | $dbGraphItem['yaxisside'], 133 | $dbGraphItem['calc_fnc'], 134 | $dbGraphItem['color'], 135 | $dbGraphItem['drawtype'], 136 | $dbGraphItem['type'] 137 | ); 138 | } 139 | 140 | $graph->draw(); 141 | 142 | 143 | require_once dirname(__FILE__).'/include/page_footer.php'; 144 | -------------------------------------------------------------------------------- /zabbix-2.0.x/big_graph.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zatree图形列表 6 | 7 | 8 | 14 | 17 | 68 | 69 | 70 | 71 | 97 |
98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 |
1小时  2小时  1天  2天  7天  30天  1年  2年
106 |
107 | 108 |
109 |
110 | 111 | 112 | 113 |
114 | 115 | -------------------------------------------------------------------------------- /zabbix-2.0.x/left.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zabbix实例 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
    22 | 23 | 70 | 71 |



    72 | 73 | 74 | -------------------------------------------------------------------------------- /zabbix-2.0.x/page.class.php: -------------------------------------------------------------------------------- 1 | pageArray = $pagearray; 27 | 28 | if (count($params) > 0) { 29 | $this->initialize($params); 30 | } 31 | } 32 | 33 | function initialize($params) { 34 | 35 | if (count($params) > 0) { 36 | $this->total = isset($params['total']) ? intval($params['total']) : 0; //总条数 37 | $this->perpage = isset($params['perpage']) ? intval($params['perpage']) : 30; //每页条数 38 | $this->nowindex = isset($params['nowindex']) ? intval($params['nowindex']) : 1; //当前页 39 | $this->url = isset($params['url']) ? $params['url'] : ''; //url地址 40 | $this->next_page = isset($params['next_page']) ? $params['next_page'] : '下一页'; 41 | $this->pre_page = isset($params['pre_page']) ? $params['pre_page'] : '上一页'; 42 | $this->first_page = isset($params['first_page']) ? $params['first_page'] : '首页'; 43 | $this->last_page = isset($params['last_page']) ? $params['last_page'] : '末页'; 44 | $this->search_contion = isset($params['search_contion']) ? $params['search_contion'] : ''; 45 | $this->search_key = isset($params['searchkey']) ? $params['searchkey'] : ''; 46 | } 47 | $this->totalpage = ceil($this->total / $this->perpage); //总页数 48 | } 49 | 50 | /** 51 | * 获取显示"下一页"的代码 52 | * 53 | * @param string $style 54 | * @return string 55 | */ 56 | function next_page($style = 'pg_next') { 57 | if ($this->nowindex < $this->totalpage) { 58 | return $this->_get_link($this->_get_url($this->nowindex + 1), $this->next_page, $style); 59 | } 60 | return '' . $this->next_page . ''; 61 | } 62 | 63 | /** 64 | * 获取显示“上一页”的代码 65 | * 66 | * @param string $style 67 | * @return string 68 | */ 69 | function pre_page($style = 'pg_pre') { 70 | if ($this->nowindex > 1) { 71 | return $this->_get_link($this->_get_url($this->nowindex - 1), $this->pre_page, $style); 72 | } 73 | return '' . $this->pre_page . ''; 74 | } 75 | 76 | /** 77 | * 获取显示“首页”的代码 78 | * 79 | * @param string $style 80 | * @return string 81 | */ 82 | function first_page($style = 'pg_first') { 83 | if ($this->nowindex == 1) { 84 | return '' . $this->first_page . ''; 85 | } 86 | return $this->_get_link($this->_get_url(1), $this->first_page, $style); 87 | } 88 | 89 | /** 90 | * 获取显示“尾页”的代码 91 | * 92 | * @param string $style 93 | * @return string 94 | */ 95 | function last_page($style = 'pg_last') { 96 | if ($this->nowindex == $this->totalpage) { 97 | return '' . $this->last_page . ''; 98 | } 99 | return $this->_get_link($this->_get_url($this->totalpage), $this->last_page, $style); 100 | } 101 | 102 | /** 103 | * 获取显示“当前页”的代码 104 | * 105 | * @param string $style 106 | * @param string $nowindex_style 107 | * @return string 108 | */ 109 | function nowbar($style = 'pg_link', $nowindex_style = 'pg_curr') { 110 | $plus = $this->part; 111 | $begin = 1; 112 | $end = $this->totalpage; 113 | 114 | if ($this->nowindex > $plus) { 115 | $begin = $this->nowindex - $plus; 116 | $end = $this->nowindex + $plus; 117 | if ($end > $this->totalpage) { 118 | $begin = ($begin - $end + $this->totalpage > 0) ? ($begin - $end + $this->totalpage) : 1; 119 | $end = $this->totalpage; 120 | } 121 | } else { 122 | $begin = 1; 123 | $end = $begin + 2 * $plus; 124 | $end = $end > $this->totalpage ? $this->totalpage : $end; 125 | } 126 | $out = ''; 127 | for ($i = $begin; $i <= $end; $i++) { 128 | if ($i != $this->nowindex) { 129 | $out.= $this->_get_link($this->_get_url($i), $i, $style); 130 | } else { 131 | $out.= '' . $i . ''; 132 | } 133 | } 134 | 135 | return $out; 136 | } 137 | 138 | /** 139 | * 获取显示跳转按钮的代码 140 | * 141 | * @return string 142 | */ 143 | function select() { 144 | $out = ''; 153 | return $out; 154 | } 155 | 156 | /** 157 | * 控制分页显示风格 158 | * 159 | * @param int $mode 160 | * @return string 161 | */ 162 | function show($mode = 1) { 163 | switch ($mode) { 164 | case 1://上一页 1 2 3 4 5 下一页 第x页 165 | $start = ($this->nowindex - 1) * $this->perpage + 1; 166 | $end = $start + count($this->_get_result()) - 1; 167 | return '第' . $start . '条到' . $end . '条,共' . count($this->pageArray) . '条数据 ' . $this->pre_page() . $this->nowbar() . $this->next_page(); 168 | break; 169 | case 2://首页 上一页 1 2 3 4 5 下一页 末页 第x页 170 | return $this->first_page() . $this->pre_page() . $this->nowbar() . $this->next_page() . $this->last_page() . ' 第' . $this->select() . '页'; 171 | break; 172 | case 3://上一页 1 2 3 4 5 下一页 173 | return $this->pre_page() . $this->nowbar() . $this->next_page(); 174 | break; 175 | default://上一页 1 2 3 4 5 下一页 第x页 176 | return $this->pre_page() . $this->nowbar() . $this->next_page() . ' 第' . $this->select() . '页'; 177 | break; 178 | } 179 | } 180 | 181 | /* ----------------private function (私有方法)----------------------------------------------------------- */ 182 | 183 | /** 184 | * 为指定的页面返回地址值 185 | * 186 | * @param int $pagenum 187 | * @return string $url 188 | */ 189 | function _get_url($pagenum = 1) { 190 | return $this->url . '&page=' . $pagenum; 191 | } 192 | 193 | /** 194 | * 获取链接地址 195 | */ 196 | function _get_link($url, $text, $style = '') { 197 | $style = $style ? 'class="' . $style . '"' : ''; 198 | return '' . $text . ''; 199 | } 200 | 201 | /* 202 | * 获取当前页返回的数据 203 | * 204 | * */ 205 | 206 | function _get_result() { 207 | $_return = array(); 208 | $this->pageArray = array_values($this->pageArray); 209 | $start = ($this->nowindex - 1) * $this->perpage; 210 | $arrleng = count($this->pageArray); 211 | 212 | for ($i = $start; $i < ($start + $this->perpage); $i++) { 213 | if ($i >= $arrleng) 214 | break; 215 | array_push($_return, $this->pageArray[$i]); 216 | } 217 | 218 | return $_return; 219 | } 220 | 221 | } 222 | 223 | ?> 224 | -------------------------------------------------------------------------------- /zabbix-2.0.x/screenshots/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/screenshots/1.jpg -------------------------------------------------------------------------------- /zabbix-2.0.x/screenshots/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/screenshots/2.jpg -------------------------------------------------------------------------------- /zabbix-2.0.x/screenshots/IMG_7649.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/screenshots/IMG_7649.JPG -------------------------------------------------------------------------------- /zabbix-2.0.x/screenshots/IMG_7650.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/screenshots/IMG_7650.JPG -------------------------------------------------------------------------------- /zabbix-2.0.x/screenshots/yunweibang-weixin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/screenshots/yunweibang-weixin.jpg -------------------------------------------------------------------------------- /zabbix-2.0.x/static/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/blank.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/static/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/fancybox_buttons.png -------------------------------------------------------------------------------- /zabbix-2.0.x/static/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/fancybox_loading.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/static/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/fancybox_overlay.png -------------------------------------------------------------------------------- /zabbix-2.0.x/static/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/fancybox_sprite.png -------------------------------------------------------------------------------- /zabbix-2.0.x/static/jquery.fancybox.min.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ .fancybox-wrap,.fancybox-skin,.fancybox-outer,.fancybox-inner,.fancybox-image,.fancybox-wrap iframe,.fancybox-wrap object,.fancybox-nav,.fancybox-nav span,.fancybox-tmp{padding:0;margin:0;border:0;outline:0;vertical-align:top}.fancybox-wrap{position:absolute;top:0;left:0;z-index:8020}.fancybox-skin{position:relative;background:#f9f9f9;color:#444;text-shadow:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.fancybox-opened{z-index:8030}.fancybox-opened .fancybox-skin{-webkit-box-shadow:0 10px 25px rgba(0,0,0,.5);-moz-box-shadow:0 10px 25px rgba(0,0,0,.5);box-shadow:0 10px 25px rgba(0,0,0,.5)}.fancybox-outer,.fancybox-inner{position:relative}.fancybox-inner{overflow:hidden}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch}.fancybox-error{color:#444;font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;margin:0;padding:15px;white-space:nowrap}.fancybox-image,.fancybox-iframe{display:block;width:100%;height:100%}.fancybox-image{max-width:100%;max-height:100%}#fancybox-loading,.fancybox-close,.fancybox-prev span,.fancybox-next span{background-image:url(fancybox_sprite.png)}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:8060}#fancybox-loading div{width:44px;height:44px;background:url(fancybox_loading.gif) center center no-repeat}.fancybox-close{position:absolute;top:-18px;right:-18px;width:36px;height:36px;cursor:pointer;z-index:8040}.fancybox-nav{position:absolute;top:0;width:40%;height:100%;cursor:pointer;text-decoration:none;background:transparent url(blank.gif);-webkit-tap-highlight-color:rgba(0,0,0,0);z-index:8040}.fancybox-prev{left:0}.fancybox-next{right:0}.fancybox-nav span{position:absolute;top:50%;width:36px;height:34px;margin-top:-18px;cursor:pointer;z-index:8040;visibility:hidden}.fancybox-prev span{left:10px;background-position:0 -36px}.fancybox-next span{right:10px;background-position:0 -72px}.fancybox-nav:hover span{visibility:visible}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;visibility:hidden;max-width:99999px;max-height:99999px;overflow:visible!important}.fancybox-lock{overflow:hidden}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:8010;background:url(fancybox_overlay.png)}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll}.fancybox-title{visibility:hidden;font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;text-shadow:none;z-index:8050}.fancybox-opened .fancybox-title{visibility:visible}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-35px;z-index:8050;text-align:center}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:transparent;background:rgba(0,0,0,.8);-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;text-shadow:0 1px 2px #222;color:#FFF;font-weight:700;line-height:24px;white-space:nowrap}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff}.fancybox-title-inside-wrap{padding-top:10px}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8)} -------------------------------------------------------------------------------- /zabbix-2.0.x/static/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/line_conn.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/static/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/loading.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/static/page.css: -------------------------------------------------------------------------------- 1 | .page{ 2 | font-size: 12px; 3 | height: 30px; 4 | width: 1080px; 5 | text-align: right; 6 | } 7 | .pg_pre,.pg_next{ 8 | border: 1px solid #ccc; 9 | margin:0 3px; 10 | /* 11 | background-image: url("../image/icon_pg.gif"); 12 | */ 13 | background-repeat:no-repeat; 14 | } 15 | .pg_pre{ 16 | padding: 3px 8px 3px 20px; 17 | background-position:7px 3px; 18 | } 19 | a.pg_pre{ 20 | background-position:7px -19px; 21 | } 22 | .pg_next{ 23 | padding: 3px 20px 3px 8px; 24 | background-position:-22px 3px; 25 | } 26 | a.pg_next{ 27 | background-position:-22px -19px; 28 | } 29 | 30 | .pg_link{ 31 | padding: 3px 8px; 32 | margin:0 3px; 33 | border: 1px solid #ccc; 34 | } 35 | .pg_link:hover,a.pg_next:hover,a.pg_pre:hover{ 36 | border: 1px solid #A9C9E2; 37 | color: #137cce; 38 | } 39 | .pg_curr{ 40 | padding: 3px 8px; 41 | margin:0 3px; 42 | color: #137cce; 43 | background-color: #E8F5FE; 44 | border: 1px solid #A9C9E2; 45 | 46 | } 47 | .pg_select{ 48 | border:1px solid #ccc; 49 | padding:2px; 50 | margin:0 5px; 51 | } -------------------------------------------------------------------------------- /zabbix-2.0.x/static/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/zTreeStandard.gif -------------------------------------------------------------------------------- /zabbix-2.0.x/static/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.0.x/static/zTreeStandard.png -------------------------------------------------------------------------------- /zabbix-2.0.x/static/zTreeStyle.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style 3 | 4 | version: 3.4 5 | author: Hunter.z 6 | email: hunter.z@263.net 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | 11 | .ztree * {padding:0; margin:0; font-size:10px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} 12 | .ztree {margin:0; padding:1px; color:#333} 13 | .ztree li{padding:0; margin:0 0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} 14 | .ztree li ul{ margin:0; padding:0 0 0 12px} 15 | .ztree li ul.line{ background:url(line_conn.gif) 0 0 repeat-y;} 16 | 17 | .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; 18 | text-decoration:none; vertical-align:top; display: inline-block} 19 | .ztree li a:hover {text-decoration:underline} 20 | .ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 21 | .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 22 | .ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; 23 | opacity:0.8; filter:alpha(opacity=80)} 24 | .ztree li a.tmpTargetNode_prev {} 25 | .ztree li a.tmpTargetNode_next {} 26 | .ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; 27 | font-size:12px; border:1px #7EC4CC solid; *border:0px} 28 | .ztree li span {line-height:16px; margin-right:2px} 29 | .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; 30 | border:0 none; cursor: pointer;outline:none; 31 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 32 | background-image:url("zTreeStandard.png"); *background-image:url("zTreeStandard.gif")} 33 | 34 | .ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} 35 | .ztree li span.button.chk.checkbox_false_full {background-position:0 0} 36 | .ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} 37 | .ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} 38 | .ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} 39 | .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} 40 | .ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} 41 | .ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} 42 | .ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} 43 | .ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} 44 | .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} 45 | .ztree li span.button.chk.radio_false_full {background-position:-28px 0} 46 | .ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} 47 | .ztree li span.button.chk.radio_false_part {background-position:-28px -28px} 48 | .ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} 49 | .ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} 50 | .ztree li span.button.chk.radio_true_full {background-position:-42px 0} 51 | .ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} 52 | .ztree li span.button.chk.radio_true_part {background-position:-42px -28px} 53 | .ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} 54 | .ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} 55 | 56 | .ztree li span.button.switch {width:14px; height:18px} 57 | .ztree li span.button.root_open{background-position:-92px -54px} 58 | .ztree li span.button.root_close{background-position:-74px -54px} 59 | .ztree li span.button.roots_open{background-position:-92px 0} 60 | .ztree li span.button.roots_close{background-position:-74px 0} 61 | .ztree li span.button.center_open{background-position:-92px -18px} 62 | .ztree li span.button.center_close{background-position:-74px -18px} 63 | .ztree li span.button.bottom_open{background-position:-92px -36px} 64 | .ztree li span.button.bottom_close{background-position:-74px -36px} 65 | .ztree li span.button.noline_open{background-position:-92px -72px} 66 | .ztree li span.button.noline_close{background-position:-74px -72px} 67 | .ztree li span.button.root_docu{ background:none;} 68 | .ztree li span.button.roots_docu{background-position:-56px 0} 69 | .ztree li span.button.center_docu{background-position:-56px -18px} 70 | .ztree li span.button.bottom_docu{background-position:-56px -36px} 71 | .ztree li span.button.noline_docu{ background:none;} 72 | 73 | .ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} 74 | .ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} 75 | .ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} 76 | .ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} 77 | .ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} 78 | 79 | .ztree li span.button.ico_loading{margin-right:2px; background:url(loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} 80 | 81 | ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} 82 | 83 | span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; 84 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 85 | background-position:-110px -80px; background-image:url("zTreeStandard.png"); *background-image:url("zTreeStandard.gif")} 86 | 87 | ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} 88 | .zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} 89 | .ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle} 90 | /* 91 | div#rMenu {position:absolute; visibility:hidden; top:0; background-color: #555;text-align: left;padding: 2px;} 92 | div#rMenu ul li{ 93 | margin: 1px 0; 94 | padding: 0 5px; 95 | cursor: pointer; 96 | list-style: none outside none; 97 | background-color: #DFDFDF; 98 | } 99 | */ 100 | 101 | /* level style*/ 102 | /*.ztree li span.button.level0 { 103 | display:none; 104 | } 105 | .ztree li ul.level0 { 106 | padding:0; 107 | background:none; 108 | }*/ -------------------------------------------------------------------------------- /zabbix-2.0.x/static/ztreedemo.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, th { 4 | margin: 0;padding: 0;border: 0;outline: 0;font-weight: inherit;font-style: inherit;font-size: 100%;font-family: inherit;vertical-align: baseline;}*/ 5 | 6 | 7 | body {color: #2f332a;font: 15px/21px Arial, Helvetica, simsun, sans-serif;background: #f0f6e4 \9;} 8 | h1, h2, h3, h4, h5, h6 {color: #2f332a;font-weight: bold;font-family: Helvetica, Arial, sans-serif;padding-bottom: 5px;} 9 | h1 {font-size: 24px;line-height: 34px;text-align: center;} 10 | h2 {font-size: 14px;line-height: 24px;padding-top: 5px;} 11 | h6 {font-weight: normal;font-size: 12px;letter-spacing: 1px;line-height: 24px;text-align: center;} 12 | a {color:#3C6E31;text-decoration: underline;} 13 | a:hover {color:white;} 14 | input.radio {margin: 0 2px 0 8px;} 15 | input.radio.first {margin-left:0;} 16 | input.empty {color: lightgray;} 17 | code {color: #2f332a;} 18 | .highlight_red {color:#A60000;} 19 | .highlight_green {color:#A7F43D;} 20 | li {list-style: circle;font-size: 12px;} 21 | li.title {list-style: none;} 22 | ul.list {margin-left: 17px;} 23 | 24 | div.content_wrap {width: 600px;height:380px;} 25 | div.content_wrap div.left{float: left;width: 250px;} 26 | div.content_wrap div.right{float: right;width: 340px;} 27 | div.zTreeDemoBackground {width:250px;height:362px;text-align:left;} 28 | 29 | ul.ztree { 30 | color: #333333; 31 | margin: 0; 32 | padding: 0; 33 | } 34 | ul.log {border: 1px solid #617775;background: #f0f6e4;width:300px;height:170px;overflow: hidden;} 35 | ul.log.small {height:45px;} 36 | ul.log li {color: #666666;list-style: none;padding-left: 10px;} 37 | ul.log li.dark {background-color: #E3E3E3;} 38 | 39 | /* ruler */ 40 | div.ruler {height:20px; width:220px; background-color:#f0f6e4;border: 1px solid #333; margin-bottom: 5px; cursor: pointer} 41 | div.ruler div.cursor {height:20px; width:30px; background-color:#3C6E31; color:white; text-align: right; padding-right: 5px; cursor: pointer} -------------------------------------------------------------------------------- /zabbix-2.0.x/zabbix.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zabbix实例 6 | 7 | 8 | 9 | 10 | 11 | 12 | <body> 13 | </body> 14 | -------------------------------------------------------------------------------- /zabbix-2.0.x/zabbix_ajax.php: -------------------------------------------------------------------------------- 1 | 3600, '2hour' => 7200, '1days' => 3600 * 24, '2days' => 3600 * 48, '7days' => 3600 * 24 * 7, '30days' => 3600 * 24 * 30, '1years' => 3600 * 24 * 365, '2years' => 3600 * 24 * 365 * 2); 21 | $changeType = $_POST['changeType']; 22 | $endTime = time(); 23 | $beginTime = $endTime - $changedayList[$changeType]; 24 | 25 | echo "{endTime:" . json_encode(date("Y-m-d H:i:s", $endTime)) . ",beginTime:" . json_encode(date("Y-m-d H:i:s", $beginTime)) . "}"; 26 | exit; 27 | } 28 | 29 | 30 | 31 | global $zabbix_api_config; 32 | 33 | $url_http = dirname(dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"])); 34 | 35 | $zabbixApi = new ZabbixApi($url_http . '/' . trim($zabbix_api_config['api_url']), trim($zabbix_api_config['user']), trim($zabbix_api_config['passowrd'])); 36 | $groupid = isset($_GET["groupid"]) ? $_GET["groupid"] : 0; 37 | 38 | if ($groupid > 0) { 39 | //根据分组id查询分组下的机器 40 | $hosts = $zabbixApi->hostGet(array("output" => "extend", "monitored_hosts" => true, "groupids" => array($groupid), "sortfield" => array("host"), "sortorder" => array("ASC"))); 41 | $new_list = array(); 42 | foreach ($hosts as $each_host) { 43 | //$new_list[ip2long($each_host->host)]=$each_host; 44 | $new_list[] = $each_host; 45 | } 46 | ksort($new_list); 47 | foreach ($new_list as &$each_host_new) { 48 | $each_host_new->target = 'rightFrame'; 49 | $each_host_new->groupids = $groupid; 50 | $each_host_new->url = 'graph.php?hostid=' . $each_host_new->hostid; 51 | } 52 | echo json_encode(array_values($new_list)); 53 | } else { 54 | //查询所有的分组列表 55 | $groups = $zabbixApi->hostgroupGet(array("output" => "extend", "monitored_hosts" => true, "sortfield"=>"name")); 56 | foreach ($groups as &$each) { 57 | $each->id = $each->groupid; 58 | $each->isParent = true; 59 | $each->target = 'rightFrame'; 60 | $each->url = 'graph.php?group_class=' . $each->groupid; 61 | 62 | //查询下面有多少机器 63 | $hosts = $zabbixApi->hostGet(array("output" => "extend", "monitored_hosts" => true, "groupids" => array($each->groupid))); 64 | $each->name = $each->name . '(' . count($hosts) . ')'; 65 | } 66 | echo json_encode($groups); 67 | } 68 | } 69 | ?> -------------------------------------------------------------------------------- /zabbix-2.0.x/zabbix_config.php: -------------------------------------------------------------------------------- 1 | 'api_jsonrpc.php', 6 | 'user'=>'xxx', 7 | 'passowrd'=>'xxx', 8 | 'graph_url'=>'zabbix_chart.php', 9 | ); 10 | 11 | ?> 12 | -------------------------------------------------------------------------------- /zabbix-2.2.x/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /zabbix-2.2.x/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/WdatePicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 Beta3 3 | * License: http://www.my97.net/dp/license.asp 4 | */ 5 | var $dp,WdatePicker;(function(){var $={ 6 | $langList:[ 7 | {name:"en",charset:"UTF-8"}, 8 | {name:"zh-cn",charset:"UTF-8"}, 9 | {name:"zh-tw",charset:"UTF-8"}], 10 | $skinList:[ 11 | {name:"default",charset:"gb2312"}, 12 | {name:"whyGreen",charset:"gb2312"}, 13 | {name:"blue",charset:"gb2312"}, 14 | {name:"ext",charset:"gb2312"}, 15 | {name:"twoer",charset:"gb2312"}], 16 | $wdate:true, 17 | $crossFrame:true, 18 | $preLoad:false, 19 | $dpPath:"", 20 | doubleCalendar:false, 21 | enableKeyboard:true, 22 | enableInputMask:true, 23 | autoUpdateOnChanged:null, 24 | weekMethod:"ISO8601", 25 | position:{}, 26 | lang:"auto", 27 | skin:"default", 28 | dateFmt:"yyyy-MM-dd", 29 | realDateFmt:"yyyy-MM-dd", 30 | realTimeFmt:"HH:mm:ss", 31 | realFullFmt:"%Date %Time", 32 | minDate:"1900-01-01 00:00:00", 33 | maxDate:"2099-12-31 23:59:59", 34 | startDate:"", 35 | alwaysUseStartDate:false, 36 | yearOffset:1911, 37 | firstDayOfWeek:0, 38 | isShowWeek:false, 39 | highLineWeekDay:true, 40 | isShowClear:true, 41 | isShowToday:true, 42 | isShowOK:true, 43 | isShowOthers:true, 44 | readOnly:false, 45 | errDealMode:0, 46 | autoPickDate:null, 47 | qsEnabled:true, 48 | autoShowQS:false, 49 | 50 | specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,opposite:false,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,elProp:"",errMsg:"",quickSel:[],has:{},getRealLang:function(){var _=$.$langList;for(var A=0;A<_.length;A++)if(_[A].name==this.lang)return _[A];return _[0]}};WdatePicker=T;var X=window,S={innerHTML:""},M="document",H="documentElement",C="getElementsByTagName",U,A,R,G,a,W=navigator.appName;if(W=="Microsoft Internet Explorer")R=true;else if(W=="Opera")a=true;else G=true;A=$.$dpPath||J();if($.$wdate)K(A+"skin/WdatePicker.css");U=X;if($.$crossFrame){try{while(U.parent!=U&&U.parent[M][C]("frameset").length==0)U=U.parent}catch(N){}}if(!U.$dp)U.$dp={ff:G,ie:R,opera:a,status:0,defMinDate:$.minDate,defMaxDate:$.maxDate};B();if($.$preLoad&&$dp.status==0)E(X,"onload",function(){T(null,true)});if(!X[M].docMD){E(X[M],"onmousedown",D);X[M].docMD=true}if(!U[M].docMD){E(U[M],"onmousedown",D);U[M].docMD=true}E(X,"onunload",function(){if($dp.dd)O($dp.dd,"none")});function B(){try{U[M],U.$dp=U.$dp||{}}catch($){U=X;$dp=$dp||{}}var A={win:X,$:function($){return(typeof $=="string")?X[M].getElementById($):$},$D:function($,_){return this.$DV(this.$($).value,_)},$DV:function(_,$){if(_!=""){this.dt=$dp.cal.splitDate(_,$dp.cal.dateFmt);if($)for(var B in $)if(this.dt[B]===undefined)this.errMsg="invalid property:"+B;else{this.dt[B]+=$[B];if(B=="M"){var C=$["M"]>0?1:0,A=new Date(this.dt["y"],this.dt["M"],0).getDate();this.dt["d"]=Math.min(A+C,this.dt["d"])}}if(this.dt.refresh())return this.dt}return""},show:function(){var A=U[M].getElementsByTagName("div"),$=100000;for(var B=0;B$)$=_}this.dd.style.zIndex=$+2;O(this.dd,"block")},hide:function(){O(this.dd,"none")},attachEvent:E};for(var _ in A)U.$dp[_]=A[_];$dp=U.$dp}function E(A,$,_){if(R)A.attachEvent($,_);else if(_){var B=$.replace(/on/,"");_._ieEmuEventHandler=function($){return _($)};A.addEventListener(B,_._ieEmuEventHandler,false)}}function J(){var _,A,$=X[M][C]("script");for(var B=0;B<$.length;B++){_=$[B].getAttribute("src")||"";_=_.substr(0,_.toLowerCase().indexOf("wdatepicker.js"));A=_.lastIndexOf("/");if(A>0)_=_.substring(0,A+1);if(_)break}return _}function K(A,$,B){var D=X[M][C]("HEAD").item(0),_=X[M].createElement("link");if(D){_.href=A;_.rel="stylesheet";_.type="text/css";if($)_.title=$;if(B)_.charset=B;D.appendChild(_)}}function F($){$=$||U;var A=0,_=0;while($!=U){var D=$.parent[M][C]("iframe");for(var F=0;F_.scrollTop||A.scrollLeft>_.scrollLeft))?A:_;return{"top":B.scrollTop,"left":B.scrollLeft}}function D($){try{var _=$?($.srcElement||$.target):null;if($dp.cal&&!$dp.eCont&&$dp.dd&&_!=$dp.el&&$dp.dd.style.display=="block")$dp.cal.close()}catch($){}}function Y(){$dp.status=2}var P,_;function T(N,F){if(!$dp)return;B();N=N||{};for(var K in $)if(K.substring(0,1)!="$"&&N[K]===undefined)N[K]=$[K];if(F){if(!L()){_=_||setInterval(function(){if(U[M].readyState=="complete")clearInterval(_);T(null,true)},50);return}if($dp.status==0){$dp.status=1;N.el=S;I(N,true)}else return}else if(N.eCont){N.eCont=$dp.$(N.eCont);N.el=S;N.autoPickDate=true;N.qsEnabled=false;I(N)}else{if($.$preLoad&&$dp.status!=2)return;var J=H();if(X.event===J||J){N.srcEl=J.srcElement||J.target;J.cancelBubble=true}N.el=N.el=$dp.$(N.el||N.srcEl);if(!N.el||N.el["My97Mark"]===true||N.el.disabled||($dp.dd&&O($dp.dd)!="none"&&$dp.dd.style.left!="-970px")){try{if(N.el["My97Mark"])N.el["My97Mark"]=false}catch(C){}return}if(J&&N.el.nodeType==1&&N.el["My97Mark"]===undefined){var A,D;if(J.type=="focus")E(N.el,"onclick",function(){T(N)});else E(N.el,"onfocus",function(){T(N)})}I(N)}function L(){if(R&&U!=X&&U[M].readyState!="complete")return false;return true}function H(){if(G){func=H.caller;while(func!=null){var $=func.arguments[0];if($&&($+"").indexOf("Event")>=0)return $;func=func.caller}return null}return event}}function Q(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function O(_,$){if(_)if($!=null)_.style.display=$;else return Q(_,"display")}function I(G,_){var D=G.el?G.el.nodeName:"INPUT";if(_||G.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(D))G.elProp=D=="INPUT"?"value":"innerHTML";else return;if(G.lang=="auto")G.lang=R?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase();if(!G.eCont)for(var C in G)$dp[C]=G[C];if(!$dp.dd||G.eCont||($dp.dd&&(G.getRealLang().name!=$dp.dd.lang||G.skin!=$dp.dd.skin))){if(G.eCont)E(G.eCont,G);else{$dp.dd=U[M].createElement("DIV");$dp.dd.style.cssText="position:absolute";U[M].body.appendChild($dp.dd);E($dp.dd,G);if(_)$dp.dd.style.left=$dp.dd.style.top="-970px";else{$dp.show();B($dp)}}}else if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont)B($dp)}function E(I,H){var G=X[M].domain,E=false;I.innerHTML="";var _=$.$langList,C=$.$skinList,F;try{F=I.lastChild.contentWindow[M]}catch(D){E=true;I.lastChild.src="javascript:void((function(){document.open();document.domain='"+G+"';})())";F=I.lastChild.contentWindow[M]}var K=H.getRealLang();I.lang=K.name;I.skin=H.skin;var J=[""];if(E)J[1]="document.domain=\""+G+"\";";for(var L=0;L");J.push("");J.push("");J.push("");H.setPos=B;H.onload=Y;F.write("");F.cfg=H;F.write(J.join(""));F.close()}function B(J){var H=J.position.left,C=J.position.top,D=J.el;if(D==S)return;if(D!=J.srcEl&&(O(D)=="none"||D.type=="hidden"))D=J.srcEl;var I=V(D),$=F(X),E=L(U),B=Z(U),G=$dp.dd.offsetHeight,A=$dp.dd.offsetWidth;if(isNaN(C))C=0;if(($.topM+I.bottom+G>E.height)&&($.topM+I.top-G>0))C+=B.top+$.topM+I.top-G-2;else{C+=B.top+$.topM+I.bottom;var _=C-B.top+G-E.height;if(_>0)C-=_}if(isNaN(H))H=0;H+=B.left+Math.min($.leftM+I.left,E.width-A-5)-(R?2:0);J.dd.style.top=C+"px";J.dd.style.left=H+"px"}}})() -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/lang/en.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "Invalid date or the date out of range,redo or not?", 3 | aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 4 | aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], 5 | aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 6 | aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], 7 | clearStr: "Clear", 8 | todayStr: "Today", 9 | okStr: "OK", 10 | updateStr: "OK", 11 | timeStr: "Time", 12 | quickStr: "Quick Selection", 13 | err_1: 'MinDate Cannot be bigger than MaxDate!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u786E\u5B9A", 10 | updateStr: "\u786E\u5B9A", 11 | timeStr: "\u65F6\u95F4", 12 | quickStr: "\u5FEB\u901F\u9009\u62E9", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/lang/zh-tw.js: -------------------------------------------------------------------------------- 1 | var $lang={ 2 | errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?", 3 | aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], 4 | aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], 5 | aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], 6 | aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], 7 | clearStr: "\u6E05\u7A7A", 8 | todayStr: "\u4ECA\u5929", 9 | okStr: "\u78BA\u5B9A", 10 | updateStr: "\u78BA\u5B9A", 11 | timeStr: "\u6642\u9593", 12 | quickStr: "\u5FEB\u901F\u9078\u64C7", 13 | err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!' 14 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/WdatePicker.css: -------------------------------------------------------------------------------- 1 | .Wdate{ 2 | border:#999 1px solid; 3 | height:20px; 4 | background:#fff url(datePicker.gif) no-repeat right; 5 | } 6 | 7 | .WdateFmtErr{ 8 | font-weight:bold; 9 | color:red; 10 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/datePicker.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/My97DatePicker/skin/datePicker.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/default/datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 3 | */ 4 | 5 | .WdateDiv{ 6 | width:180px; 7 | background-color:#FFFFFF; 8 | border:#bbb 1px solid; 9 | padding:2px; 10 | } 11 | 12 | .WdateDiv2{ 13 | width:360px; 14 | } 15 | .WdateDiv *{font-size:9pt;} 16 | 17 | .WdateDiv .NavImg a{ 18 | display:block; 19 | cursor:pointer; 20 | height:16px; 21 | width:16px; 22 | } 23 | 24 | .WdateDiv .NavImgll a{ 25 | float:left; 26 | background:transparent url(img.gif) no-repeat scroll 0 0; 27 | } 28 | .WdateDiv .NavImgl a{ 29 | float:left; 30 | background:transparent url(img.gif) no-repeat scroll -16px 0; 31 | } 32 | .WdateDiv .NavImgr a{ 33 | float:right; 34 | background:transparent url(img.gif) no-repeat scroll -32px 0; 35 | } 36 | .WdateDiv .NavImgrr a{ 37 | float:right; 38 | background:transparent url(img.gif) no-repeat scroll -48px 0; 39 | } 40 | 41 | .WdateDiv #dpTitle{ 42 | height:24px; 43 | margin-bottom:2px; 44 | padding:1px; 45 | } 46 | 47 | .WdateDiv .yminput{ 48 | margin-top:2px; 49 | text-align:center; 50 | height:20px; 51 | border:0px; 52 | width:50px; 53 | cursor:pointer; 54 | } 55 | 56 | .WdateDiv .yminputfocus{ 57 | margin-top:2px; 58 | text-align:center; 59 | font-weight:bold; 60 | height:20px; 61 | color:blue; 62 | border:#ccc 1px solid; 63 | width:50px; 64 | } 65 | 66 | .WdateDiv .menuSel{ 67 | z-index:1; 68 | position:absolute; 69 | background-color:#FFFFFF; 70 | border:#ccc 1px solid; 71 | display:none; 72 | } 73 | 74 | .WdateDiv .menu{ 75 | cursor:pointer; 76 | background-color:#fff; 77 | } 78 | 79 | .WdateDiv .menuOn{ 80 | cursor:pointer; 81 | background-color:#BEEBEE; 82 | } 83 | 84 | .WdateDiv .invalidMenu{ 85 | color:#aaa; 86 | } 87 | 88 | .WdateDiv .YMenu{ 89 | margin-top:20px; 90 | 91 | } 92 | 93 | .WdateDiv .MMenu{ 94 | margin-top:20px; 95 | *width:62px; 96 | } 97 | 98 | .WdateDiv .hhMenu{ 99 | margin-top:-90px; 100 | margin-left:26px; 101 | } 102 | 103 | .WdateDiv .mmMenu{ 104 | margin-top:-46px; 105 | margin-left:26px; 106 | } 107 | 108 | .WdateDiv .ssMenu{ 109 | margin-top:-24px; 110 | margin-left:26px; 111 | } 112 | 113 | .WdateDiv .Wweek { 114 | text-align:center; 115 | background:#DAF3F5; 116 | border-right:#BDEBEE 1px solid; 117 | } 118 | 119 | .WdateDiv .MTitle{ 120 | background-color:#BDEBEE; 121 | } 122 | .WdateDiv .WdayTable2{ 123 | border-collapse:collapse; 124 | border:#c5d9e8 1px solid; 125 | } 126 | .WdateDiv .WdayTable2 table{ 127 | border:0; 128 | } 129 | 130 | .WdateDiv .WdayTable{ 131 | line-height:20px; 132 | border:#c5d9e8 1px solid; 133 | } 134 | .WdateDiv .WdayTable td{ 135 | text-align:center; 136 | } 137 | 138 | .WdateDiv .Wday{ 139 | cursor:pointer; 140 | } 141 | 142 | .WdateDiv .WdayOn{ 143 | cursor:pointer; 144 | background-color:#C0EBEF; 145 | } 146 | 147 | .WdateDiv .Wwday{ 148 | cursor:pointer; 149 | color:#FF2F2F; 150 | } 151 | 152 | .WdateDiv .WwdayOn{ 153 | cursor:pointer; 154 | color:#000; 155 | background-color:#C0EBEF; 156 | } 157 | .WdateDiv .Wtoday{ 158 | cursor:pointer; 159 | color:blue; 160 | } 161 | .WdateDiv .Wselday{ 162 | background-color:#A9E4E9; 163 | } 164 | .WdateDiv .WspecialDay{ 165 | background-color:#66F4DF; 166 | } 167 | 168 | .WdateDiv .WotherDay{ 169 | cursor:pointer; 170 | color:#6A6AFF; 171 | } 172 | 173 | .WdateDiv .WotherDayOn{ 174 | cursor:pointer; 175 | background-color:#C0EBEF; 176 | } 177 | 178 | .WdateDiv .WinvalidDay{ 179 | color:#aaa; 180 | } 181 | 182 | .WdateDiv #dpTime{ 183 | float:left; 184 | margin-top:3px; 185 | margin-right:30px; 186 | } 187 | 188 | .WdateDiv #dpTime #dpTimeStr{ 189 | margin-left:1px; 190 | } 191 | 192 | .WdateDiv #dpTime input{ 193 | width:18px; 194 | height:20px; 195 | text-align:center; 196 | border:#ccc 1px solid; 197 | } 198 | 199 | .WdateDiv #dpTime .tB{ 200 | border-right:0px; 201 | } 202 | 203 | .WdateDiv #dpTime .tE{ 204 | border-left:0; 205 | border-right:0; 206 | } 207 | 208 | .WdateDiv #dpTime .tm{ 209 | width:7px; 210 | border-left:0; 211 | border-right:0; 212 | } 213 | 214 | .WdateDiv #dpTime #dpTimeUp{ 215 | height:10px; 216 | width:13px; 217 | border:0px; 218 | background:url(img.gif) no-repeat -32px -16px; 219 | } 220 | 221 | .WdateDiv #dpTime #dpTimeDown{ 222 | height:10px; 223 | width:13px; 224 | border:0px; 225 | background:url(img.gif) no-repeat -48px -16px; 226 | } 227 | 228 | .WdateDiv #dpQS { 229 | float:left; 230 | margin-right:3px; 231 | margin-top:3px; 232 | background:url(img.gif) no-repeat 0px -16px; 233 | width:20px; 234 | height:20px; 235 | cursor:pointer; 236 | } 237 | .WdateDiv #dpControl { 238 | text-align:right; 239 | } 240 | .WdateDiv .dpButton{ 241 | height:20px; 242 | width:45px; 243 | border:#ccc 1px solid; 244 | margin-top:2px; 245 | margin-right:1px; 246 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/default/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/My97DatePicker/skin/default/img.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/whyGreen/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/My97DatePicker/skin/whyGreen/bg.jpg -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/whyGreen/datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | * My97 DatePicker 4.8 Skin:whyGreen 3 | */ 4 | .WdateDiv{ 5 | width:180px; 6 | background-color:#fff; 7 | border:#C5E1E4 1px solid; 8 | padding:2px; 9 | } 10 | 11 | .WdateDiv2{ 12 | width:360px; 13 | } 14 | .WdateDiv *{font-size:9pt;} 15 | 16 | .WdateDiv .NavImg a{ 17 | cursor:pointer; 18 | display:block; 19 | width:16px; 20 | height:16px; 21 | margin-top:1px; 22 | } 23 | 24 | .WdateDiv .NavImgll a{ 25 | float:left; 26 | background:url(img.gif) no-repeat; 27 | } 28 | .WdateDiv .NavImgl a{ 29 | float:left; 30 | background:url(img.gif) no-repeat -16px 0px; 31 | } 32 | .WdateDiv .NavImgr a{ 33 | float:right; 34 | background:url(img.gif) no-repeat -32px 0px; 35 | } 36 | .WdateDiv .NavImgrr a{ 37 | float:right; 38 | background:url(img.gif) no-repeat -48px 0px; 39 | } 40 | 41 | .WdateDiv #dpTitle{ 42 | height:24px; 43 | padding:1px; 44 | border:#c5d9e8 1px solid; 45 | background:url(bg.jpg); 46 | margin-bottom:2px; 47 | } 48 | 49 | .WdateDiv .yminput{ 50 | margin-top:2px; 51 | text-align:center; 52 | border:0px; 53 | height:20px; 54 | width:50px; 55 | color:#034c50; 56 | background-color:transparent; 57 | cursor:pointer; 58 | } 59 | 60 | .WdateDiv .yminputfocus{ 61 | margin-top:2px; 62 | text-align:center; 63 | border:#939393 1px solid; 64 | font-weight:bold; 65 | color:#034c50; 66 | height:20px; 67 | width:50px; 68 | } 69 | 70 | .WdateDiv .menuSel{ 71 | z-index:1; 72 | position:absolute; 73 | background-color:#FFFFFF; 74 | border:#A3C6C8 1px solid; 75 | display:none; 76 | } 77 | 78 | .WdateDiv .menu{ 79 | cursor:pointer; 80 | background-color:#fff; 81 | color:#11777C; 82 | } 83 | 84 | .WdateDiv .menuOn{ 85 | cursor:pointer; 86 | background-color:#BEEBEE; 87 | } 88 | 89 | .WdateDiv .invalidMenu{ 90 | color:#aaa; 91 | } 92 | 93 | .WdateDiv .YMenu{ 94 | margin-top:20px; 95 | } 96 | 97 | .WdateDiv .MMenu{ 98 | margin-top:20px; 99 | *width:62px; 100 | } 101 | 102 | .WdateDiv .hhMenu{ 103 | margin-top:-90px; 104 | margin-left:26px; 105 | } 106 | 107 | .WdateDiv .mmMenu{ 108 | margin-top:-46px; 109 | margin-left:26px; 110 | } 111 | 112 | .WdateDiv .ssMenu{ 113 | margin-top:-24px; 114 | margin-left:26px; 115 | } 116 | 117 | .WdateDiv .Wweek { 118 | text-align:center; 119 | background:#DAF3F5; 120 | border-right:#BDEBEE 1px solid; 121 | } 122 | 123 | .WdateDiv .MTitle{ 124 | color:#13777e; 125 | background-color:#bdebee; 126 | } 127 | .WdateDiv .WdayTable2{ 128 | border-collapse:collapse; 129 | border:#BEE9F0 1px solid; 130 | } 131 | .WdateDiv .WdayTable2 table{ 132 | border:0; 133 | } 134 | 135 | .WdateDiv .WdayTable{ 136 | line-height:20px; 137 | color:#13777e; 138 | background-color:#edfbfb; 139 | border:#BEE9F0 1px solid; 140 | } 141 | .WdateDiv .WdayTable td{ 142 | text-align:center; 143 | } 144 | 145 | .WdateDiv .Wday{ 146 | cursor:pointer; 147 | } 148 | 149 | .WdateDiv .WdayOn{ 150 | cursor:pointer; 151 | background-color:#74d2d9 ; 152 | } 153 | 154 | .WdateDiv .Wwday{ 155 | cursor:pointer; 156 | color:#ab1e1e; 157 | } 158 | 159 | .WdateDiv .WwdayOn{ 160 | cursor:pointer; 161 | background-color:#74d2d9; 162 | } 163 | .WdateDiv .Wtoday{ 164 | cursor:pointer; 165 | color:blue; 166 | } 167 | .WdateDiv .Wselday{ 168 | background-color:#A7E2E7; 169 | } 170 | .WdateDiv .WspecialDay{ 171 | background-color:#66F4DF; 172 | } 173 | 174 | .WdateDiv .WotherDay{ 175 | cursor:pointer; 176 | color:#0099CC; 177 | } 178 | 179 | .WdateDiv .WotherDayOn{ 180 | cursor:pointer; 181 | background-color:#C0EBEF; 182 | } 183 | 184 | .WdateDiv .WinvalidDay{ 185 | color:#aaa; 186 | } 187 | 188 | .WdateDiv #dpTime{ 189 | float:left; 190 | margin-top:3px; 191 | margin-right:30px; 192 | } 193 | 194 | .WdateDiv #dpTime #dpTimeStr{ 195 | margin-left:1px; 196 | color:#497F7F; 197 | } 198 | 199 | .WdateDiv #dpTime input{ 200 | height:20px; 201 | width:18px; 202 | text-align:center; 203 | color:#333; 204 | border:#61CAD0 1px solid; 205 | } 206 | 207 | .WdateDiv #dpTime .tB{ 208 | border-right:0px; 209 | } 210 | 211 | .WdateDiv #dpTime .tE{ 212 | border-left:0; 213 | border-right:0; 214 | } 215 | 216 | .WdateDiv #dpTime .tm{ 217 | width:7px; 218 | border-left:0; 219 | border-right:0; 220 | } 221 | 222 | .WdateDiv #dpTime #dpTimeUp{ 223 | height:10px; 224 | width:13px; 225 | border:0px; 226 | background:url(img.gif) no-repeat -32px -16px; 227 | } 228 | 229 | .WdateDiv #dpTime #dpTimeDown{ 230 | height:10px; 231 | width:13px; 232 | border:0px; 233 | background:url(img.gif) no-repeat -48px -16px; 234 | } 235 | 236 | .WdateDiv #dpQS { 237 | float:left; 238 | margin-right:3px; 239 | margin-top:3px; 240 | background:url(img.gif) no-repeat 0px -16px; 241 | width:20px; 242 | height:20px; 243 | cursor:pointer; 244 | } 245 | .WdateDiv #dpControl { 246 | text-align:right; 247 | margin-top:3px; 248 | } 249 | .WdateDiv .dpButton{ 250 | height:20px; 251 | width:45px; 252 | margin-top:2px; 253 | border:#38B1B9 1px solid; 254 | background-color:#CFEBEE; 255 | color:#08575B; 256 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/My97DatePicker/skin/whyGreen/img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/My97DatePicker/skin/whyGreen/img.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/README.md: -------------------------------------------------------------------------------- 1 | 2 | Zatree for zabbix 2.2.x 安装 3 | ================================== 4 | 5 | 1:下载文件 6 | 7 | git clone https://github.com/spide4k/zatree.git zatree 8 | 9 | 2:复制相关文件 10 | 11 | 假如zabbix web目录位置在/var/www/zabbix,定义zabbix目录 12 | 13 | ZABBIX_PATH=/var/www/zabbix 14 | 15 | 复制相关文件和目录 16 | 17 | cp -rf zatree/zabbix-2.2.x $ZABBIX_PATH/zatree 18 | 19 | cd $ZABBIX_PATH/zatree/addfile 20 | 21 | cp -f CLineGraphDraw_Zabbix.php CGraphDraw_Zabbix.php CImageTextTable_Zabbix.php $ZABBIX_PATH/include/classes/graphdraw/ 22 | 23 | cp -f zabbix.php zabbix_chart.php $ZABBIX_PATH/ 24 | 25 | cp -f CItemValue.php $ZABBIX_PATH/api/classes/ 26 | 27 | cp -f menu.inc.php $ZABBIX_PATH/include/ 28 | 29 | cp -f main.js $ZABBIX_PATH/js/ 30 | 31 | cp -f API.php $ZABBIX_PATH/include/classes/api/ 32 | 33 | 34 | 3:支持web interface,修改配置文件 35 | 36 | vi $ZABBIX_PATH/zatree/zabbix_config.php 37 | 38 | 'user'=>'xxx', //web登陆的用户名 39 | 40 | 'passowrd'=>'xxx', //web登陆的密码 41 | 42 | 43 | 44 | 常见问题 45 | ================================== 46 | 47 | 1:如何排错? 48 | 49 | 可以打开php的显示错误,看看什么原因 50 | 51 | vi /etc/php.ini 52 | 53 | display_errors = On 54 | 55 | 重启web server,然后监控web日志 56 | 57 | 2:Fatal error: Call to undefined function json_encode() in /var/www/html/zabbix/zatree/ZabbixApiAbstract.class.php on line 220 58 | 59 | 需要php encode支持 60 | 61 | yum install php-pecl-json 62 | 63 | 如果上面这个方法不行,找不到php-pecl-json,试试下面这个方法 64 | 65 | yum install php-pear 66 | 67 | pecl install json 68 | 69 | echo "extension=json.so" > /etc/php.d/json.ini 70 | 71 | 3:如果右侧显示一行2个图,说明你分辨率不够,叫老板给你换个机器,或者修改graph.php文件这行的width值 72 | 73 | 181 74 | 75 | 4:报以下错误 76 | 77 | Warning: array_key_exists() expects parameter 2 to be array, null given in zatree/ZabbixApiAbstract.class.php on line 255 78 | 79 | Notice: Trying to get property of non-object in zatree/ZabbixApiAbstract.class.php on line 262 80 | 81 | Warning: Invalid argument supplied for foreach() in zatree/graph.php online 130 82 | 83 | 内存溢出,修改php.ini调整大小为XXX 84 | memory_limit = XXXM 85 | 86 | 5:是否支持搜索多个关键字? 87 | 88 | 支持,关键字用逗号分隔 89 | 90 | 6:搜索选项的差值是什么意思? 91 | 92 | 在一段时间里,最大值减去最小值得到一个结果,然后用这个结果排序,这个选项对一段时间内的突发增长查看非常有用 93 | 94 | 7: 如果你的主机名都是ip,并且向排序显示,解决方法: 编辑zabbix_ajax.php 95 | 96 | 43行代码注释44打开,不支持ip排序,43行代码打开44行注释,支持ip排序 97 | 43 $new_list[ip2long($each_host->host)]=$each_host; 98 | 44 //$new_list[] = $each_host; 99 | 100 | 8: 如果zabbix是2.2.1版本,有可能会报 101 | 102 | Call to undefined method CMacrosResolverHelper::resolveItemNames() in zabbix/include/classes/api/CLineGraphDraw_Zabbix.php on line 107 103 | 解决方法:升级zabbix > 2.2.1 104 | 105 | -------------------------------------------------------------------------------- /zabbix-2.2.x/ZabbixApi.class.php: -------------------------------------------------------------------------------- 1 | . 22 | * 23 | * @copyright GNU General Public License 24 | * @author confirm IT solutions GmbH, Rathausstrase 14, CH-6340 Baar 25 | * 26 | * @version $Id: concrete.tpl.php 134 2012-08-20 15:44:55Z dbarton $ 27 | */ 28 | 29 | require 'ZabbixApiAbstract.class.php'; 30 | 31 | /** 32 | * @brief Concrete class for the Zabbix API. 33 | */ 34 | 35 | class ZabbixApi extends ZabbixApiAbstract 36 | { 37 | 38 | } 39 | 40 | ?> 41 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/API.php: -------------------------------------------------------------------------------- 1 | 'CAction', 38 | 'alert' => 'CAlert', 39 | 'apiinfo' => 'CAPIInfo', 40 | 'application' => 'CApplication', 41 | 'configuration' => 'CConfiguration', 42 | 'dcheck' => 'CDCheck', 43 | 'dhost' => 'CDHost', 44 | 'discoveryrule' => 'CDiscoveryRule', 45 | 'drule' => 'CDRule', 46 | 'dservice' => 'CDService', 47 | 'event' => 'CEvent', 48 | 'graph' => 'CGraph', 49 | 'graphitem' => 'CGraphItem', 50 | 'graphprototype' => 'CGraphPrototype', 51 | 'host' => 'CHost', 52 | 'hostgroup' => 'CHostGroup', 53 | 'hostprototype' => 'CHostPrototype', 54 | 'history' => 'CHistory', 55 | 'hostinterface' => 'CHostInterface', 56 | 'image' => 'CImage', 57 | 'iconmap' => 'CIconMap', 58 | 'item' => 'CItem', 59 | 'itemprototype' => 'CItemPrototype', 60 | 'maintenance' => 'CMaintenance', 61 | 'map' => 'CMap', 62 | 'mediatype' => 'CMediatype', 63 | 'proxy' => 'CProxy', 64 | 'service' => 'CService', 65 | 'screen' => 'CScreen', 66 | 'screenitem' => 'CScreenItem', 67 | 'script' => 'CScript', 68 | 'template' => 'CTemplate', 69 | 'templatescreen' => 'CTemplateScreen', 70 | 'templatescreenitem' => 'CTemplateScreenItem', 71 | 'trigger' => 'CTrigger', 72 | 'triggerprototype' => 'CTriggerPrototype', 73 | 'user' => 'CUser', 74 | 'itemvalue'=>'CItemValue', 75 | 'usergroup' => 'CUserGroup', 76 | 'usermacro' => 'CUserMacro', 77 | 'usermedia' => 'CUserMedia', 78 | 'httptest' => 'CHttpTest', 79 | 'webcheck' => 'CHttpTest' 80 | ); 81 | 82 | /** 83 | * Returns the class name for the given API object. The name of the object should not be case sensitive. 84 | * 85 | * @static 86 | * 87 | * @param string $object 88 | * 89 | * @return string 90 | */ 91 | public static function getObjectClassName($object) { 92 | return self::$classMap[strtolower($object)]; 93 | } 94 | 95 | public static function setReturnAPI() { 96 | self::$return = self::RETURN_TYPE_API; 97 | } 98 | 99 | public static function setReturnRPC() { 100 | self::$return = self::RETURN_TYPE_RPC; 101 | } 102 | 103 | /** 104 | * Returns an instance of the CZBXAPI class, that's responsible for handling the given 105 | * API objects requests. 106 | * 107 | * @static 108 | * 109 | * @param $object 110 | * 111 | * @return CZBXAPI 112 | */ 113 | public static function getApi($object = null) { 114 | if ($object) { 115 | $className = self::getObjectClassName($object); 116 | if (!isset(self::$APIobjects[$object])) { 117 | self::$APIobjects[$object] = new $className; 118 | } 119 | 120 | return self::$APIobjects[$object]; 121 | } 122 | else { 123 | if (!isset(self::$APIobjects[0])) { 124 | self::$APIobjects[0] = new CZBXAPI(); 125 | } 126 | 127 | return self::$APIobjects[0]; 128 | } 129 | } 130 | 131 | private static function getRpc($className) { 132 | if (!isset(self::$RPCobjects[$className])) { 133 | self::$RPCobjects[$className] = new CAPIObject($className); 134 | } 135 | 136 | return self::$RPCobjects[$className]; 137 | } 138 | 139 | public static function getObject($className) { 140 | return (self::$return == self::RETURN_TYPE_API) ? self::getApi($className) : self::getRpc($className); 141 | } 142 | 143 | /** 144 | * @return CAction 145 | */ 146 | public static function Action() { 147 | return self::getObject('action'); 148 | } 149 | 150 | /** 151 | * @return CAlert 152 | */ 153 | public static function Alert() { 154 | return self::getObject('alert'); 155 | } 156 | 157 | /** 158 | * @return CAPIInfo 159 | */ 160 | public static function APIInfo() { 161 | return self::getObject('apiinfo'); 162 | } 163 | 164 | /** 165 | * @return CApplication 166 | */ 167 | public static function Application() { 168 | return self::getObject('application'); 169 | } 170 | 171 | /** 172 | * @return CConfiguration 173 | */ 174 | public static function Configuration() { 175 | return self::getObject('configuration'); 176 | } 177 | 178 | /** 179 | * @return CDCheck 180 | */ 181 | public static function DCheck() { 182 | return self::getObject('dcheck'); 183 | } 184 | 185 | /** 186 | * @return CDHost 187 | */ 188 | public static function DHost() { 189 | return self::getObject('dhost'); 190 | } 191 | 192 | /** 193 | * @return CDiscoveryRule 194 | */ 195 | public static function DiscoveryRule() { 196 | return self::getObject('discoveryrule'); 197 | } 198 | 199 | /** 200 | * @return CDRule 201 | */ 202 | public static function DRule() { 203 | return self::getObject('drule'); 204 | } 205 | 206 | /** 207 | * @return CDService 208 | */ 209 | public static function DService() { 210 | return self::getObject('dservice'); 211 | } 212 | 213 | /** 214 | * @return CEvent 215 | */ 216 | public static function Event() { 217 | return self::getObject('event'); 218 | } 219 | 220 | /** 221 | * @return CGraph 222 | */ 223 | public static function Graph() { 224 | return self::getObject('graph'); 225 | } 226 | 227 | /** 228 | * @return CGraphItem 229 | */ 230 | public static function GraphItem() { 231 | return self::getObject('graphitem'); 232 | } 233 | 234 | /** 235 | * @return CGraphPrototype 236 | */ 237 | public static function GraphPrototype() { 238 | return self::getObject('graphprototype'); 239 | } 240 | 241 | /** 242 | * @return CHistory 243 | */ 244 | public static function History() { 245 | return self::getObject('history'); 246 | } 247 | 248 | /** 249 | * @return CHost 250 | */ 251 | public static function Host() { 252 | return self::getObject('host'); 253 | } 254 | 255 | /** 256 | * @return CHostPrototype 257 | */ 258 | public static function HostPrototype() { 259 | return self::getObject('hostprototype'); 260 | } 261 | 262 | /** 263 | * @return CHostGroup 264 | */ 265 | public static function HostGroup() { 266 | return self::getObject('hostgroup'); 267 | } 268 | 269 | /** 270 | * @return CHostInterface 271 | */ 272 | public static function HostInterface() { 273 | return self::getObject('hostinterface'); 274 | } 275 | 276 | /** 277 | * @return CImage 278 | */ 279 | public static function Image() { 280 | return self::getObject('image'); 281 | } 282 | 283 | /** 284 | * @return CIconMap 285 | */ 286 | public static function IconMap() { 287 | return self::getObject('iconmap'); 288 | } 289 | 290 | /** 291 | * @return CItem 292 | */ 293 | public static function Item() { 294 | return self::getObject('item'); 295 | } 296 | 297 | /** 298 | * @return CItemPrototype 299 | */ 300 | public static function ItemPrototype() { 301 | return self::getObject('itemprototype'); 302 | } 303 | 304 | /** 305 | * @return CMaintenance 306 | */ 307 | public static function Maintenance() { 308 | return self::getObject('maintenance'); 309 | } 310 | 311 | /** 312 | * @return CMap 313 | */ 314 | public static function Map() { 315 | return self::getObject('map'); 316 | } 317 | 318 | /** 319 | * @return CMediaType 320 | */ 321 | public static function MediaType() { 322 | return self::getObject('mediatype'); 323 | } 324 | 325 | /** 326 | * @return CProxy 327 | */ 328 | public static function Proxy() { 329 | return self::getObject('proxy'); 330 | } 331 | 332 | /** 333 | * @return CService 334 | */ 335 | public static function Service() { 336 | return self::getObject('service'); 337 | } 338 | 339 | /** 340 | * @return CScreen 341 | */ 342 | public static function Screen() { 343 | return self::getObject('screen'); 344 | } 345 | 346 | /** 347 | * @return CScreenItem 348 | */ 349 | public static function ScreenItem() { 350 | return self::getObject('screenitem'); 351 | } 352 | 353 | /** 354 | * @return CScript 355 | */ 356 | public static function Script() { 357 | return self::getObject('script'); 358 | } 359 | 360 | /** 361 | * @return CTemplate 362 | */ 363 | public static function Template() { 364 | return self::getObject('template'); 365 | } 366 | 367 | /** 368 | * @return CTemplateScreen 369 | */ 370 | public static function TemplateScreen() { 371 | return self::getObject('templatescreen'); 372 | } 373 | 374 | /** 375 | * @return CTemplateScreenItem 376 | */ 377 | public static function TemplateScreenItem() { 378 | return self::getObject('templatescreenitem'); 379 | } 380 | 381 | /** 382 | * @return CTrigger 383 | */ 384 | public static function Trigger() { 385 | return self::getObject('trigger'); 386 | } 387 | 388 | /** 389 | * @return CTriggerPrototype 390 | */ 391 | public static function TriggerPrototype() { 392 | return self::getObject('triggerprototype'); 393 | } 394 | 395 | /** 396 | * @return CUser 397 | */ 398 | public static function User() { 399 | return self::getObject('user'); 400 | } 401 | 402 | /** 403 | * @return CUserGroup 404 | */ 405 | public static function UserGroup() { 406 | return self::getObject('usergroup'); 407 | } 408 | 409 | /** 410 | * @return CUserMacro 411 | */ 412 | public static function UserMacro() { 413 | return self::getObject('usermacro'); 414 | } 415 | 416 | /** 417 | * @return CUserMedia 418 | */ 419 | public static function UserMedia() { 420 | return self::getObject('usermedia'); 421 | } 422 | 423 | /** 424 | * @return CHttpTest 425 | */ 426 | public static function HttpTest() { 427 | return self::getObject('httptest'); 428 | } 429 | } 430 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/CGraphDraw_Zabbix.php: -------------------------------------------------------------------------------- 1 | stime = null; 26 | $this->fullSizeX = null; 27 | $this->fullSizeY = null; 28 | $this->m_minY = null; 29 | $this->m_maxY = null; 30 | $this->data = array(); 31 | $this->items = null; 32 | $this->min = null; 33 | $this->max = null; 34 | $this->avg = null; 35 | $this->clock = null; 36 | $this->count = null; 37 | $this->header = null; 38 | $this->from_time = null; 39 | $this->to_time = null; 40 | $this->colors = null; 41 | $this->colorsrgb = null; 42 | $this->im = null; 43 | $this->period = SEC_PER_HOUR; 44 | $this->from = 0; 45 | $this->sizeX = 900; // default graph size X 46 | $this->sizeY = 200; // default graph size Y 47 | $this->shiftXleft = 100; 48 | $this->shiftXright = 50; 49 | $this->shiftXCaption = 0; 50 | $this->shiftY = 36; 51 | $this->border = 1; 52 | $this->num = 0; 53 | $this->type = $type; // graph type 54 | $this->drawLegend = 1; 55 | $this->axis_valuetype = array(); // overal items type (int/float) 56 | $this->graphtheme = array( 57 | 'description' => 'default', 58 | 'frontendtheme' => 'default.css', 59 | 'textcolor' => '202020', 60 | 'highlightcolor' => 'aa4444', 61 | 'backgroundcolor' => 'f0f0f0', 62 | 'graphcolor' => 'ffffff', 63 | 'graphbordercolor' => '333333', 64 | 'gridcolor' => 'cccccc', 65 | 'maingridcolor' => 'aaaaaa', 66 | 'gridbordercolor' => '000000', 67 | 'nonworktimecolor' => 'eaeaea', 68 | 'leftpercentilecolor' => '00AA00', 69 | 'righttpercentilecolor' => 'AA0000', 70 | 'legendview' => '1', 71 | 'gridview' => '1' 72 | ); 73 | $this->applyGraphTheme(); 74 | } 75 | 76 | public function initColors() { 77 | // red, green, blue, alpha 78 | $this->colorsrgb = array( 79 | 'Red' => array(255, 0, 0, 50), 80 | 'Dark Red' => array(150, 0, 0, 50), 81 | 'Green' => array(0, 255, 0, 50), 82 | 'Dark Green' => array(0, 150, 0, 50), 83 | 'Blue' => array(0, 0, 255, 50), 84 | 'Dark Blue' => array(0, 0, 150, 50), 85 | 'Yellow' => array(255, 255, 0, 50), 86 | 'Dark Yellow' => array(150, 150, 0, 50), 87 | 'Cyan' => array(0, 255, 255, 50), 88 | 'Dark Cyan' => array(0, 150, 150, 50), 89 | 'Black' => array(0, 0, 0, 50), 90 | 'Gray' => array(150, 150, 150, 50), 91 | 'White' => array(255, 255, 255), 92 | 'Dark Red No Alpha' => array(150, 0, 0), 93 | 'Black No Alpha' => array(0, 0, 0), 94 | 'HistoryMinMax' => array(90, 150, 185, 50), 95 | 'HistoryMax' => array(255, 100, 100, 50), 96 | 'HistoryMin' => array(50, 255, 50, 50), 97 | 'HistoryAvg' => array(50, 50, 50, 50), 98 | 'ValueMinMax' => array(255, 255, 150, 50), 99 | 'ValueMax' => array(255, 180, 180, 50), 100 | 'ValueMin' => array(100, 255, 100, 50), 101 | 'Not Work Period' => array(230, 230, 230), 102 | 'UnknownData' => array(130, 130, 130, 50) 103 | ); 104 | 105 | // i should rename no alpha to alpha at some point to get rid of some confusion 106 | foreach ($this->colorsrgb as $name => $RGBA) { 107 | if (isset($RGBA[3]) && function_exists('imagecolorexactalpha') 108 | && function_exists('imagecreatetruecolor') && @imagecreatetruecolor(1, 1)) { 109 | $this->colors[$name] = imagecolorexactalpha($this->im, $RGBA[0], $RGBA[1], $RGBA[2], $RGBA[3]); 110 | } 111 | else { 112 | $this->colors[$name] = imagecolorallocate($this->im, $RGBA[0], $RGBA[1], $RGBA[2]); 113 | } 114 | } 115 | } 116 | 117 | /** 118 | * Load the graph theme from the database. 119 | */ 120 | public function applyGraphTheme() { 121 | $theme = DB::find('graph_theme', array( 122 | 'theme' => getUserTheme(CWebUser::$data) 123 | )); 124 | $theme = reset($theme); 125 | if ($theme) { 126 | $this->graphtheme = $theme; 127 | } 128 | } 129 | 130 | public function showLegend($type = true) { 131 | $this->drawLegend = $type; 132 | } 133 | 134 | public function setPeriod($period) { 135 | $this->period = $period; 136 | } 137 | 138 | public function setSTime($stime) { 139 | if ($stime > 19000000000000 && $stime < 21000000000000) { 140 | $this->stime = zbxDateToTime($stime); 141 | } 142 | else { 143 | $this->stime = $stime; 144 | } 145 | } 146 | 147 | public function setFrom($from) { 148 | $this->from = $from; 149 | } 150 | 151 | public function setWidth($value = null) { 152 | // avoid sizex==0, to prevent division by zero later 153 | if ($value == 0) { 154 | $value = null; 155 | } 156 | if (is_null($value)) { 157 | $value = 900; 158 | } 159 | $this->sizeX = $value; 160 | } 161 | 162 | public function setHeight($value = null) { 163 | if ($value == 0) { 164 | $value = null; 165 | } 166 | if (is_null($value)) { 167 | $value = 200; 168 | } 169 | $this->sizeY = $value; 170 | } 171 | 172 | public function setBorder($border) { 173 | $this->border = $border; 174 | } 175 | 176 | public function getLastValue($num) { 177 | $data = &$this->data[$this->items[$num]['itemid']][$this->items[$num]['calc_type']]; 178 | 179 | if (isset($data)) { 180 | for ($i = $this->sizeX - 1; $i >= 0; $i--) { 181 | if (!empty($data['count'][$i])) { 182 | switch ($this->items[$num]['calc_fnc']) { 183 | case CALC_FNC_MIN: 184 | return $data['min'][$i]; 185 | case CALC_FNC_MAX: 186 | return $data['max'][$i]; 187 | case CALC_FNC_ALL: 188 | case CALC_FNC_AVG: 189 | default: 190 | return $data['avg'][$i]; 191 | } 192 | } 193 | } 194 | } 195 | 196 | return 0; 197 | } 198 | 199 | public function drawRectangle() { 200 | imagefilledrectangle($this->im, 0, 0, 201 | $this->fullSizeX, 202 | $this->fullSizeY, 203 | $this->getColor($this->graphtheme['backgroundcolor'], 0) 204 | ); 205 | 206 | if ($this->border == 1) { 207 | imagerectangle($this->im, 0, 0, 208 | $this->fullSizeX - 1, 209 | $this->fullSizeY - 1, 210 | $this->getColor($this->graphtheme['graphbordercolor'], 0) 211 | ); 212 | } 213 | } 214 | 215 | public function drawSmallRectangle() { 216 | dashedRectangle($this->im, 217 | $this->shiftXleft + $this->shiftXCaption - 1, 218 | $this->shiftY - 1, 219 | $this->sizeX + $this->shiftXleft + $this->shiftXCaption - 1, 220 | $this->sizeY + $this->shiftY + 1, 221 | $this->getColor('Black No Alpha') 222 | ); 223 | } 224 | 225 | public function period2str($period) { 226 | return ' ('.zbx_date2age(0, $period).')'; 227 | } 228 | 229 | public function drawHeader() { 230 | if (!isset($this->header)) { 231 | $str = $this->items[0]['hostname'].NAME_DELIMITER.$this->items[0]['name']; 232 | } 233 | else { 234 | $str = CMacrosResolverHelper::resolveGraphName($this->header, $this->items); 235 | } 236 | 237 | $str .= $this->period2str($this->period); 238 | 239 | // calculate largest font size that can fit graph header 240 | // TODO: font size must be dynamic in other parts of the graph as well, like legend, timeline, etc 241 | for ($fontsize = 11; $fontsize > 7; $fontsize--) { 242 | $dims = imageTextSize($fontsize, 0, $str); 243 | $x = $this->fullSizeX / 2 - ($dims['width'] / 2); 244 | 245 | // most important information must be displayed, period can be out of the graph 246 | if ($x < 2) { 247 | $x = 2; 248 | } 249 | if ($dims['width'] <= $this->fullSizeX) { 250 | break; 251 | } 252 | } 253 | 254 | imageText($this->im, $fontsize, 0, $x, 24, $this->getColor($this->graphtheme['textcolor'], 0), $str); 255 | } 256 | 257 | public function setHeader($header) { 258 | $this->header = $header; 259 | } 260 | 261 | public function drawLogo() { 262 | imagestringup($this->im, 0, 263 | $this->fullSizeX - 10, 264 | $this->fullSizeY - 50, 265 | //'http://www.zabbix.com', 266 | $this->getColor('Gray') 267 | ); 268 | } 269 | 270 | public function getColor($color, $alfa = 50) { 271 | if (isset($this->colors[$color])) { 272 | return $this->colors[$color]; 273 | } 274 | 275 | $RGB = array( 276 | hexdec('0x'.substr($color, 0, 2)), 277 | hexdec('0x'.substr($color, 2, 2)), 278 | hexdec('0x'.substr($color, 4, 2)) 279 | ); 280 | 281 | if (isset($alfa) && function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor') 282 | && @imagecreatetruecolor(1, 1)) { 283 | return imagecolorexactalpha($this->im, $RGB[0], $RGB[1], $RGB[2], $alfa); 284 | } 285 | 286 | return imagecolorallocate($this->im, $RGB[0], $RGB[1], $RGB[2]); 287 | } 288 | 289 | public function getShadow($color, $alfa = 0) { 290 | if (isset($this->colorsrgb[$color])) { 291 | $red = $this->colorsrgb[$color][0]; 292 | $green = $this->colorsrgb[$color][1]; 293 | $blue = $this->colorsrgb[$color][2]; 294 | } 295 | else { 296 | list($red, $green, $blue) = hex2rgb($color); 297 | } 298 | 299 | if ($this->sum > 0) { 300 | $red = (int)($red * 0.6); 301 | $green = (int)($green * 0.6); 302 | $blue = (int)($blue * 0.6); 303 | } 304 | 305 | $RGB = array($red, $green, $blue); 306 | 307 | if (isset($alfa) && function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor') 308 | && @imagecreatetruecolor(1, 1)) { 309 | return imagecolorexactalpha($this->im, $RGB[0], $RGB[1], $RGB[2], $alfa); 310 | } 311 | 312 | return imagecolorallocate($this->im, $RGB[0], $RGB[1], $RGB[2]); 313 | } 314 | } 315 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/CImageTextTable_Zabbix.php: -------------------------------------------------------------------------------- 1 | 21 | image = $image; 47 | $this->fontsize = 8; 48 | $this->rowheight = 0; 49 | $this->color = 0; 50 | $this->align = 0; 51 | $this->x = $x; 52 | $this->y = $y; 53 | $this->table = array(); 54 | $this->numrows = 0; 55 | } 56 | 57 | public function getNumRows() { 58 | return $this->numrows; 59 | } 60 | 61 | /** 62 | * Adds a new table cell. 63 | * 64 | * Supported $cell options: 65 | * - marginRight - right margin, defaults to 20 66 | * - image - resource of the image to display in the cell 67 | * - text - text to display in the cell 68 | * - color - text color resource 69 | * - align - text alignment: 0 - left, 1 - center, 2 - right 70 | * - fontsize - text font size 71 | * 72 | * @param int $numrow 73 | * @param array $cell 74 | * 75 | * @return void 76 | */ 77 | public function addCell($numrow, array $cell) { 78 | if ($numrow >= $this->numrows) { 79 | $numrow = $this->numrows; 80 | $this->numrows++; 81 | $this->table[$numrow] = array(); 82 | } 83 | $this->table[$numrow][] = $cell; 84 | } 85 | 86 | public function addRow($row) { 87 | $this->table[$this->numrows] = $row; 88 | $this->numrows++; 89 | } 90 | 91 | public function draw() { 92 | $this->calcRows(); 93 | 94 | $coly = $this->y; 95 | foreach ($this->table as $row) { 96 | $rowx = $this->x; 97 | 98 | foreach ($row as $col) { 99 | $col['marginRight'] = (isset($col['marginRight'])) ? $col['marginRight'] : 7; 100 | 101 | // draw image 102 | if (isset($col['image'])) { 103 | $imageWidth = imagesx($col['image']); 104 | $imageHeight = imagesy($col['image']); 105 | 106 | imagecopy( 107 | $this->image, 108 | $col['image'], 109 | $rowx, 110 | $coly - $imageHeight + 1, 111 | 0, 112 | 0, 113 | $imageWidth, 114 | $imageHeight 115 | ); 116 | } 117 | // draw text 118 | else { 119 | $text_color = isset($col['color']) ? $col['color'] : $this->color; 120 | $align = $this->align; 121 | if (isset($col['align'])) { 122 | if ($col['align'] == 1) { 123 | $align = floor(($col['width'] - $col['size']['width']) / 2); // center 124 | } 125 | elseif ($col['align'] == 2) { 126 | $align = $col['width'] - $col['size']['width']; // right 127 | } 128 | } 129 | imageText($this->image, $col['fontsize'], 0, $rowx+$align, $coly, $text_color, $col['text']); 130 | } 131 | 132 | $rowx += $col['width'] + $col['marginRight']; 133 | $height = $col['height']; 134 | } 135 | $coly += $height; 136 | } 137 | } 138 | 139 | /** 140 | * Calculates the size of each row and column. 141 | * 142 | * @return void 143 | */ 144 | private function calcRows() { 145 | $rowHeight = 0; 146 | $colWidth = array(); 147 | 148 | foreach ($this->table as $y => $row) { 149 | foreach ($row as $x => $col) { 150 | // calculate size from image 151 | if (isset($col['image'])) { 152 | $dims = array( 153 | 'width' => imagesx($col['image']), 154 | 'height' => imagesy($col['image']) 155 | ); 156 | } 157 | // calculate size from text 158 | else { 159 | if (!isset($col['fontsize'])) { 160 | $col['fontsize'] = $this->fontsize; 161 | } 162 | $this->table[$y][$x]['fontsize'] = $col['fontsize']; 163 | 164 | $dims = imageTextSize($col['fontsize'], 0, $col['text']); 165 | } 166 | 167 | $this->table[$y][$x]['size'] = $dims; 168 | 169 | $rowHeight = ($dims['height'] > $rowHeight) ? $dims['height'] : $rowHeight; 170 | 171 | if (!isset($colWidth[$x])) { 172 | $colWidth[$x] = $dims['width']; 173 | } 174 | elseif ($dims['width'] > $colWidth[$x]) { 175 | $colWidth[$x] = $dims['width']; 176 | } 177 | } 178 | } 179 | 180 | if ($rowHeight < $this->rowheight) { 181 | $rowHeight = $this->rowheight; 182 | } 183 | else { 184 | $this->rowheight = $rowHeight; 185 | } 186 | 187 | foreach ($this->table as $y => $row) { 188 | foreach ($row as $x => $col) { 189 | $this->table[$y][$x]['height'] = $rowHeight; 190 | $this->table[$y][$x]['width'] = $colWidth[$x]; 191 | } 192 | } 193 | } 194 | } 195 | ?> 196 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/CItemValue.php: -------------------------------------------------------------------------------- 1 | 0) : ($real_item['trends'] > 0); 62 | 63 | 64 | 65 | if (!$trendsEnabled || (($item['history'] * SEC_PER_DAY) > (time() - ($from_time + $period / 2)) && ($period / $sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL))) { // is reasonable to take data from history? 66 | //$this->dataFrom = 'history'; 67 | array_push($sql_arr, 'SELECT itemid,' . $calc_field . ' AS i,' . 68 | 'COUNT(*) AS count,AVG(value) AS avg,MIN(value) as min,' . 69 | 'MAX(value) AS max,MAX(clock) AS clock' . 70 | ' FROM history ' . 71 | ' WHERE itemid=' . $itemInfo['itemid'] . 72 | ' AND clock>=' . $from_time . 73 | ' AND clock<=' . $to_time . 74 | ' GROUP BY itemid,' . $calc_field 75 | , 'SELECT itemid,' . $calc_field . ' AS i,' . 76 | 'COUNT(*) AS count,AVG(value) AS avg,MIN(value) AS min,' . 77 | 'MAX(value) AS max,MAX(clock) AS clock' . 78 | ' FROM history_uint ' . 79 | ' WHERE itemid=' . $itemInfo['itemid'] . 80 | ' AND clock>=' . $from_time . 81 | ' AND clock<=' . $to_time . 82 | ' GROUP BY itemid,' . $calc_field 83 | ); 84 | } else { 85 | //$this->dataFrom = 'trends'; 86 | array_push($sql_arr, 'SELECT itemid,' . $calc_field . ' AS i,' . 87 | 'SUM(num) AS count,AVG(value_avg) AS avg,MIN(value_min) AS min,' . 88 | 'MAX(value_max) AS max,MAX(clock) AS clock' . 89 | ' FROM trends' . 90 | ' WHERE itemid=' . $itemInfo['itemid'] . 91 | ' AND clock>=' . $from_time . 92 | ' AND clock<=' . $to_time . 93 | ' GROUP BY itemid,' . $calc_field 94 | , 'SELECT itemid,' . $calc_field . ' AS i,' . 95 | 'SUM(num) AS count,AVG(value_avg) AS avg,MIN(value_min) AS min,' . 96 | 'MAX(value_max) AS max,MAX(clock) AS clock' . 97 | ' FROM trends_uint ' . 98 | ' WHERE itemid=' . $itemInfo['itemid'] . 99 | ' AND clock>=' . $from_time . 100 | ' AND clock<=' . $to_time . 101 | ' GROUP BY itemid,' . $calc_field 102 | ); 103 | 104 | $itemInfo['delay'] = max($itemInfo['delay'], SEC_PER_HOUR); 105 | } 106 | 107 | $curr_data['count'] = null; 108 | $curr_data['min'] = null; 109 | $curr_data['max'] = null; 110 | $curr_data['avg'] = null; 111 | $curr_data['clock'] = null; 112 | 113 | 114 | foreach ($sql_arr as $sql) { 115 | 116 | $result = DBselect($sql); 117 | while ($row = DBfetch($result)) { 118 | $idx = $row['i'] - 1; 119 | if ($idx < 0) { 120 | continue; 121 | } 122 | 123 | 124 | $curr_data['count'][$idx] = $row['count']; 125 | $curr_data['min'][$idx] = $row['min']; 126 | $curr_data['max'][$idx] = $row['max']; 127 | $curr_data['avg'][$idx] = $row['avg']; 128 | $curr_data['clock'][$idx] = $row['clock']; 129 | $curr_data['shift_min'][$idx] = 0; 130 | $curr_data['shift_max'][$idx] = 0; 131 | $curr_data['shift_avg'][$idx] = 0; 132 | } 133 | unset($row); 134 | } 135 | $curr_data['avg_orig'] = is_array($curr_data['avg']) ? zbx_avg($curr_data['avg']) : null; 136 | return $curr_data; 137 | } 138 | 139 | public function getLastValueBy($data) { 140 | //$data = &$this->newData[$item['itemid']][$item['calc_type']]; 141 | if (isset($data)) { 142 | for ($i = 286 - 1; $i >= 0; $i--) { 143 | if (!empty($data['count'][$i])) { 144 | switch ($item['calc_fnc']) { 145 | case CALC_FNC_MIN: 146 | return $data['min'][$i]; 147 | case CALC_FNC_MAX: 148 | return $data['max'][$i]; 149 | case CALC_FNC_ALL: 150 | case CALC_FNC_AVG: 151 | default: 152 | return $data['avg'][$i]; 153 | } 154 | } 155 | } 156 | } 157 | return 0; 158 | } 159 | 160 | public function getItemListFormat($list = array()) { 161 | $itemList = $list['list_item']; 162 | $parame = $list['parame']; 163 | 164 | $search_key = $parame['item_name_search']; 165 | 166 | $order_result_list = array(); 167 | 168 | $search = 0; 169 | if (empty($search_key)) { 170 | $search_key_list = array(); 171 | } else { 172 | $search_key_list = explode(",", $search_key); 173 | } 174 | 175 | if (count($search_key_list) >= 1) { 176 | $search = 1; 177 | } 178 | 179 | foreach ($itemList as $each_item) { 180 | $each_item = (array) $each_item; 181 | 182 | $item = get_item_by_itemid($each_item['itemid']); 183 | 184 | $newItem = $item; 185 | // $newItem['name'] = itemName($item); 186 | $newItem['name'] = $item['name']; 187 | 188 | $newItem['delay'] = getItemDelay($item['delay'], $item['delay_flex']); 189 | 190 | $host = get_host_by_hostid($item['hostid']); 191 | 192 | $newItem['hostname'] = $host['name']; 193 | 194 | if (strpos($item['units'], ',') !== false) { 195 | list($newItem['units'], $newItem['unitsLong']) = explode(',', $item['units']); 196 | } else { 197 | $newItem['unitsLong'] = ''; 198 | } 199 | 200 | if ($search == 0) { 201 | $newItem['graphid'] = $each_item['graphid']; 202 | $order_result_list[$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => 0, 'min' => 0, 'avg' => 0, 'max' => 0, 'hostname' => $newItem['hostname'], 'chazhi' => 0); 203 | } else { 204 | 205 | foreach ($search_key_list as $each_search_key) { 206 | $each_search_key = trim($each_search_key); 207 | //按关键字进行筛选 208 | if (strpos(strtolower($newItem['name']), strtolower($each_search_key)) === false) { 209 | 210 | } else { 211 | $newItem['calc_fnc'] = is_null($each_item['calc_fnc']) ? CALC_FNC_AVG : $each_item->calc_fnc; 212 | $newItem['calc_type'] = GRAPH_ITEM_SIMPLE; 213 | $newItem['graphid'] = $each_item['graphid']; 214 | 215 | $item_info_new = array_merge($newItem, $parame); 216 | 217 | $data = self::GetItemValues($item_info_new); 218 | 219 | if (isset($data) && isset($data['min'])) { 220 | 221 | $lastvalue = convert_units(self::getLastValueBy($data), $newItem['units'], ITEM_CONVERT_NO_UNITS); 222 | $min = convert_units(min($data['min']), $newItem['units'], ITEM_CONVERT_NO_UNITS); 223 | $avg = convert_units($data['avg_orig'], $newItem['units'], ITEM_CONVERT_NO_UNITS); 224 | $max = convert_units(max($data['max']), $newItem['units'], ITEM_CONVERT_NO_UNITS); 225 | //return array("lastvalue"=>$lastvalue,'min'=>$min,'avg'=>$avg,'max'=>$max); 226 | $order_result_list[$each_search_key][$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => self::getLastValueBy($data), 'min' => min($data['min']), 'avg' => $data['avg_orig'], 'max' => max($data['max']), 'hostname' => $newItem['hostname'], 'chazhi' => max($data['max']) - min($data['min'])); 227 | } else { 228 | $order_result_list[$each_search_key][$newItem['graphid']] = array("graphid" => $newItem['graphid'], "itemname" => $newItem['name'], "lastvalue" => 0, 'min' => 0, 'avg' => 0, 'max' => 0, 'hostname' => $newItem['hostname'], 'chazhi' => 0); 229 | } 230 | break; 231 | } 232 | } 233 | } 234 | } 235 | 236 | return $order_result_list; 237 | } 238 | 239 | } 240 | 241 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/menu.inc.php: -------------------------------------------------------------------------------- 1 | array( 26 | 'label' => _('Monitoring'), 27 | 'user_type' => USER_TYPE_ZABBIX_USER, 28 | 'node_perm' => PERM_READ, 29 | 'default_page_id' => 0, 30 | 'pages' => array( 31 | array( 32 | 'url' => 'dashboard.php', 33 | 'label' => _('Dashboard'), 34 | 'sub_pages' => array('dashconf.php') 35 | ), 36 | array( 37 | 'url' => 'overview.php', 38 | 'label' => _('Overview') 39 | ), 40 | array( 41 | 'url' => 'httpmon.php', 42 | 'label' => _('Web'), 43 | 'sub_pages' => array('httpdetails.php') 44 | ), 45 | array( 46 | 'url' => 'latest.php', 47 | 'label' => _('Latest data'), 48 | 'sub_pages' => array('history.php', 'chart.php') 49 | ), 50 | array( 51 | 'url' => 'tr_status.php', 52 | 'label' => _('Triggers'), 53 | 'sub_pages' => array('acknow.php', 'tr_comments.php', 'chart4.php', 'scripts_exec.php') 54 | ), 55 | array( 56 | 'url' => 'events.php', 57 | 'label' => _('Events'), 58 | 'sub_pages' => array('tr_events.php') 59 | ), 60 | array( 61 | 'url' => 'charts.php', 62 | 'label' => _('Graphs'), 63 | 'sub_pages' => array('chart2.php', 'chart3.php', 'chart6.php', 'chart7.php') 64 | ), 65 | array( 66 | 'url' => 'screens.php', 67 | 'label' => _('Screens'), 68 | 'sub_pages' => array('slides.php') 69 | ), 70 | array( 71 | 'url' => 'maps.php', 72 | 'label' => _('Maps'), 73 | 'sub_pages' => array('map.php') 74 | ), 75 | array( 76 | 'url' => 'discovery.php', 77 | 'label' => _('Discovery'), 78 | 'user_type' => USER_TYPE_ZABBIX_ADMIN 79 | ), 80 | array( 81 | 'url' => 'srv_status.php', 82 | 'label' => _('IT services'), 83 | 'force_disable_all_nodes' => true, 84 | 'sub_pages' => array('report3.php', 'chart5.php') 85 | ), 86 | array( 87 | 'url' => 'chart3.php' 88 | ), 89 | array( 90 | 'url' => 'imgstore.php' 91 | ), 92 | array( 93 | 'url' => 'search.php' 94 | ), 95 | array( 96 | 'url' => 'jsrpc.php' 97 | ) 98 | ) 99 | ), 100 | 'cm' => array( 101 | 'label' => _('Inventory'), 102 | 'user_type' => USER_TYPE_ZABBIX_USER, 103 | 'node_perm' => PERM_READ, 104 | 'default_page_id' => 0, 105 | 'pages' => array( 106 | array( 107 | 'url' => 'hostinventoriesoverview.php', 108 | 'label' => _('Overview') 109 | ), 110 | array( 111 | 'url' => 'hostinventories.php', 112 | 'label' => _('Hosts') 113 | ) 114 | ) 115 | ), 116 | 'reports' => array( 117 | 'label' => _('Reports'), 118 | 'user_type' => USER_TYPE_ZABBIX_USER, 119 | 'node_perm' => PERM_READ, 120 | 'default_page_id' => 0, 121 | 'pages' => array( 122 | array( 123 | 'url' => 'report1.php', 124 | 'label' => _('Status of Zabbix'), 125 | 'user_type' => USER_TYPE_SUPER_ADMIN 126 | ), 127 | array( 128 | 'url' => 'report2.php', 129 | 'label' => _('Availability report') 130 | ), 131 | array( 132 | 'url' => 'report5.php', 133 | 'label' => _('Triggers top 100') 134 | ), 135 | array( 136 | 'url' => 'report6.php', 137 | 'label' => _('Bar reports'), 138 | 'sub_pages' => array('popup_period.php', 'popup_bitem.php', 'chart_bar.php') 139 | ), 140 | array( 141 | 'url' => 'popup.php' 142 | ), 143 | array( 144 | 'url' => 'popup_right.php' 145 | ) 146 | ), 147 | ), 148 | 'config' => array( 149 | 'label' => _('Configuration'), 150 | 'user_type' => USER_TYPE_ZABBIX_ADMIN, 151 | 'node_perm' => PERM_READ, 152 | 'default_page_id' => 0, 153 | 'force_disable_all_nodes' => true, 154 | 'pages' => array( 155 | array( 156 | 'url' => 'conf.import.php' 157 | ), 158 | array( 159 | 'url' => 'hostgroups.php', 160 | 'label' => _('Host groups') 161 | ), 162 | array( 163 | 'url' => 'templates.php', 164 | 'label' => _('Templates') 165 | ), 166 | array( 167 | 'url' => 'hosts.php', 168 | 'label' => _('Hosts'), 169 | 'sub_pages' => array( 170 | 'items.php', 171 | 'triggers.php', 172 | 'graphs.php', 173 | 'applications.php', 174 | 'tr_logform.php', 175 | 'tr_testexpr.php', 176 | 'popup_trexpr.php', 177 | 'host_discovery.php', 178 | 'disc_prototypes.php', 179 | 'trigger_prototypes.php', 180 | 'host_prototypes.php', 181 | 'httpconf.php', 182 | 'popup_httpstep.php' 183 | ) 184 | ), 185 | array( 186 | 'url' => 'maintenance.php', 187 | 'label' => _('Maintenance') 188 | ), 189 | array( 190 | 'url' => 'actionconf.php', 191 | 'label' => _('Actions') 192 | ), 193 | array( 194 | 'url' => 'screenconf.php', 195 | 'label' => _('Screens'), 196 | 'sub_pages' => array('screenedit.php') 197 | ), 198 | array( 199 | 'url' => 'slideconf.php', 200 | 'label' => _('Slide shows'), 201 | ), 202 | array( 203 | 'url' => 'sysmaps.php', 204 | 'label' => _('Maps'), 205 | 'sub_pages' => array('image.php', 'sysmap.php') 206 | ), 207 | array( 208 | 'url' => 'discoveryconf.php', 209 | 'label' => _('Discovery') 210 | ), 211 | array( 212 | 'url' => 'services.php', 213 | 'label' => _('IT services') 214 | ), 215 | ) 216 | ), 217 | 'admin' => array( 218 | 'label' => _('Administration'), 219 | 'user_type' => USER_TYPE_SUPER_ADMIN, 220 | 'node_perm' => PERM_READ_WRITE, 221 | 'default_page_id' => 1, 222 | 'force_disable_all_nodes'=> true, 223 | 'pages' => array( 224 | array( 225 | 'url' => 'adm.gui.php', 226 | 'label' => _('General'), 227 | 'sub_pages' => array( 228 | 'adm.housekeeper.php', 229 | 'adm.images.php', 230 | 'adm.iconmapping.php', 231 | 'adm.regexps.php', 232 | 'adm.macros.php', 233 | 'adm.valuemapping.php', 234 | 'adm.workingtime.php', 235 | 'adm.triggerseverities.php', 236 | 'adm.triggerdisplayoptions.php', 237 | 'adm.other.php' 238 | ) 239 | ), 240 | array( 241 | 'url' => 'proxies.php', 242 | 'label' => _('DM'), 243 | 'sub_pages' => array('nodes.php') 244 | ), 245 | array( 246 | 'url' => 'authentication.php', 247 | 'label' => _('Authentication') 248 | ), 249 | array( 250 | 'url' => 'usergrps.php', 251 | 'label' => _('Users'), 252 | 'sub_pages' => array('users.php', 'popup_usrgrp.php') 253 | ), 254 | array( 255 | 'url' => 'media_types.php', 256 | 'label' => _('Media types') 257 | ), 258 | array( 259 | 'url' => 'scripts.php', 260 | 'label' => _('Scripts') 261 | ), 262 | array( 263 | 'url' => 'auditlogs.php', 264 | 'label' => _('Audit'), 265 | 'sub_pages' => array('auditacts.php') 266 | ), 267 | array( 268 | 'url' => 'queue.php', 269 | 'label' => _('Queue') 270 | ), 271 | array( 272 | 'url' => 'report4.php', 273 | 'label' => _('Notifications') 274 | ), 275 | array( 276 | 'url' => 'setup.php', 277 | 'label' => _('Installation') 278 | ) 279 | ) 280 | ), 281 | 282 | 'zatree'=>array( 283 | 'label' => _('Zatree'), 284 | 'user_type' => USER_TYPE_ZABBIX_USER, 285 | 'default_page_id' => 0, 286 | 'force_disable_all_nodes' => true, 287 | 'pages' =>array( 288 | array('url' => 'zabbix.php','label' => _('Zatree'),) 289 | ) 290 | 291 | ), 292 | 293 | 'login' => array( 294 | 'label' => _('Login'), 295 | 'user_type' => 0, 296 | 'default_page_id' => 0, 297 | 'hide_node_selection' => 1, 298 | 'force_disable_all_nodes'=> true, 299 | 'pages' => array( 300 | array( 301 | 'url' => 'index.php', 302 | 'sub_pages' => array('profile.php', 'popup_media.php') 303 | ) 304 | ) 305 | ) 306 | ); 307 | 308 | /** 309 | * NOTE - menu array format: 310 | * first level: 311 | * 'label' = main menu title. 312 | * 'default_page_id = default page url from 'pages' then opened menu. 313 | * 'pages' = collection of pages which are displayed from this menu. 314 | * these pages are saved a last visited submenu of main menu. 315 | * 316 | * second level (pages): 317 | * 'url' = real url for this page 318 | * 'label' = submenu title, if missing, menu skipped, but remembered as last visited page. 319 | * 'sub_pages' = collection of pages for displaying but not remembered as last visited. 320 | */ 321 | function zbx_construct_menu(&$main_menu, &$sub_menus, &$page) { 322 | global $ZBX_MENU; 323 | 324 | $denied_page_requested = false; 325 | $page_exists = false; 326 | $deny = !defined('ZBX_PAGE_NO_AUTHORIZATION'); 327 | 328 | foreach ($ZBX_MENU as $label => $menu) { 329 | $show_menu = true; 330 | 331 | if (isset($menu['user_type'])) { 332 | $show_menu &= ($menu['user_type'] <= CWebUser::$data['type']); 333 | } 334 | if ($label == 'login') { 335 | $show_menu = false; 336 | } 337 | 338 | $menu_class = 'horizontal_menu_n'; 339 | $sub_menus[$label] = array(); 340 | foreach ($menu['pages'] as $sub_page) { 341 | $show_sub_menu = true; 342 | 343 | // show check 344 | if (!isset($sub_page['label'])) { 345 | $show_sub_menu = false; 346 | } 347 | if (!isset($sub_page['user_type'])) { 348 | $sub_page['user_type'] = $menu['user_type']; 349 | } 350 | if (CWebUser::$data['type'] < $sub_page['user_type']) { 351 | $show_sub_menu = false; 352 | } 353 | 354 | $row = array( 355 | 'menu_text' => isset($sub_page['label']) ? $sub_page['label'] : '', 356 | 'menu_url' => $sub_page['url'], 357 | 'class' => 'highlight', 358 | 'selected' => false 359 | ); 360 | $sub_menu_active = ($page['file'] == $sub_page['url']); 361 | $sub_menu_active |= (isset($sub_page['sub_pages']) && str_in_array($page['file'], $sub_page['sub_pages'])); 362 | 363 | if ($sub_menu_active) { 364 | // permition check 365 | $deny &= (CWebUser::$data['type'] < $menu['user_type'] || CWebUser::$data['type'] < $sub_page['user_type']); 366 | 367 | $menu_class = 'active'; 368 | $page_exists = true; 369 | $page['menu'] = $label; 370 | $row['selected'] = true; 371 | 372 | if (!defined('ZBX_PAGE_NO_MENU')) { 373 | CProfile::update('web.menu.'.$label.'.last', $sub_page['url'], PROFILE_TYPE_STR); 374 | } 375 | } 376 | 377 | if ($show_sub_menu) { 378 | $sub_menus[$label][] = $row; 379 | } 380 | } 381 | 382 | if ($page_exists && !defined('ZBX_NOT_ALLOW_ALL_NODES') && (isset($menu['force_disable_all_nodes']) || isset($sub_page['force_disable_all_nodes']))) { 383 | define('ZBX_NOT_ALLOW_ALL_NODES', 1); 384 | } 385 | 386 | if ($page_exists && $deny) { 387 | $denied_page_requested = true; 388 | } 389 | 390 | if (!$show_menu) { 391 | unset($sub_menus[$label]); 392 | continue; 393 | } 394 | 395 | $menu_url = $sub_menus[$label][$menu['default_page_id']]['menu_url']; 396 | $mmenu_entry = new CCol($menu['label'], $menu_class); 397 | $mmenu_entry->setAttribute('id', $label); 398 | $mmenu_entry->addAction('onclick', 'javascript: redirect(\''.$menu_url.'\');'); 399 | $mmenu_entry->addAction('onmouseover', 'javascript: MMenu.mouseOver(\''.$label.'\');'); 400 | $mmenu_entry->addAction('onmouseout', 'javascript: MMenu.mouseOut();'); 401 | array_push($main_menu, $mmenu_entry); 402 | } 403 | 404 | if (!$page_exists && $page['type'] != PAGE_TYPE_XML && $page['type'] != PAGE_TYPE_CSV && $page['type'] != PAGE_TYPE_TEXT_FILE) { 405 | $denied_page_requested = true; 406 | } 407 | 408 | return $denied_page_requested; 409 | } 410 | 411 | function zbx_define_menu_restrictions($page, $ZBX_MENU) { 412 | foreach ($ZBX_MENU as $section) { 413 | foreach ($section['pages'] as $menu_page) { 414 | if ($menu_page['url'] == $page['file'] || (isset($menu_page['sub_pages']) && str_in_array($page['file'], $menu_page['sub_pages']))) { 415 | if (isset($section['force_disable_all_nodes']) && !defined('ZBX_NOT_ALLOW_ALL_NODES')) { 416 | define('ZBX_NOT_ALLOW_ALL_NODES', 1); 417 | } 418 | if (isset($section['hide_node_selection']) && !defined('ZBX_HIDE_NODE_SELECTION')) { 419 | define('ZBX_HIDE_NODE_SELECTION', 1); 420 | } 421 | return null; 422 | } 423 | } 424 | } 425 | } 426 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/zabbix.php: -------------------------------------------------------------------------------- 1 | checkAuthentication($_COOKIE['zbx_sessionid']); 15 | 16 | if($date['alias']=='guest'){ 17 | header ( "Location:/zabbix/" ); 18 | }else{ 19 | require_once dirname(__FILE__).'/zatree/zabbix.php'; 20 | } 21 | }else{ 22 | header ( "Location:/zabbix/" ); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /zabbix-2.2.x/addfile/zabbix_chart.php: -------------------------------------------------------------------------------- 1 | array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), 33 | 'period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 34 | 'stime' => array(T_ZBX_STR, O_OPT, P_SYS, null, null), 35 | 'profileIdx' => array(T_ZBX_STR, O_OPT, null, null, null), 36 | 'profileIdx2' => array(T_ZBX_STR, O_OPT, null, null, null), 37 | 'updateProfile' => array(T_ZBX_STR, O_OPT, null, null, null), 38 | 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 39 | 'width' => array(T_ZBX_INT, O_OPT, P_NZERO, '{}>0', null), 40 | 'height' => array(T_ZBX_INT, O_OPT, P_NZERO, '{}>0', null) 41 | ); 42 | check_fields($fields); 43 | 44 | /* 45 | * Permissions 46 | */ 47 | $dbGraph = API::Graph()->get(array( 48 | 'graphids' => $_REQUEST['graphid'], 49 | 'output' => API_OUTPUT_EXTEND 50 | )); 51 | if (!$dbGraph) { 52 | access_deny(); 53 | } 54 | else { 55 | $dbGraph = reset($dbGraph); 56 | } 57 | 58 | $host = API::Host()->get(array( 59 | 'nodeids' => get_current_nodeid(true), 60 | 'graphids' => $_REQUEST['graphid'], 61 | 'output' => API_OUTPUT_EXTEND, 62 | 'templated_hosts' => true 63 | )); 64 | $host = reset($host); 65 | 66 | /* 67 | * Display 68 | */ 69 | $timeline = CScreenBase::calculateTime(array( 70 | 'profileIdx' => get_request('profileIdx', 'web.screens'), 71 | 'profileIdx2' => get_request('profileIdx2'), 72 | 'updateProfile' => get_request('updateProfile', true), 73 | 'period' => get_request('period'), 74 | 'stime' => get_request('stime') 75 | )); 76 | 77 | CProfile::update('web.screens.graphid', $_REQUEST['graphid'], PROFILE_TYPE_ID); 78 | 79 | $chartHeader = ''; 80 | if (id2nodeid($dbGraph['graphid']) != get_current_nodeid()) { 81 | $chartHeader = get_node_name_by_elid($dbGraph['graphid'], true, NAME_DELIMITER); 82 | } 83 | $chartHeader .= $host['name'].NAME_DELIMITER.$dbGraph['name']; 84 | 85 | $graph = new CLineGraphDraw_Zabbix($dbGraph['graphtype']); 86 | $graph->setHeader($chartHeader); 87 | $graph->setPeriod($timeline['period']); 88 | $graph->setSTime($timeline['stime']); 89 | 90 | if (isset($_REQUEST['border'])) { 91 | $graph->setBorder(0); 92 | } 93 | 94 | $width = get_request('width', 0); 95 | if ($width <= 0) { 96 | $width = $dbGraph['width']; 97 | } 98 | 99 | $height = get_request('height', 0); 100 | if ($height <= 0) { 101 | $height = $dbGraph['height']; 102 | } 103 | 104 | $graph->showLegend($dbGraph['show_legend']); 105 | $graph->showWorkPeriod($dbGraph['show_work_period']); 106 | $graph->showTriggers($dbGraph['show_triggers']); 107 | $graph->setWidth($width); 108 | $graph->setHeight($height); 109 | $graph->setYMinAxisType($dbGraph['ymin_type']); 110 | $graph->setYMaxAxisType($dbGraph['ymax_type']); 111 | $graph->setYAxisMin($dbGraph['yaxismin']); 112 | $graph->setYAxisMax($dbGraph['yaxismax']); 113 | $graph->setYMinItemId($dbGraph['ymin_itemid']); 114 | $graph->setYMaxItemId($dbGraph['ymax_itemid']); 115 | $graph->setLeftPercentage($dbGraph['percent_left']); 116 | $graph->setRightPercentage($dbGraph['percent_right']); 117 | 118 | $dbGraphItems = DBselect( 119 | 'SELECT gi.*'. 120 | ' FROM graphs_items gi'. 121 | ' WHERE gi.graphid='.zbx_dbstr($dbGraph['graphid']). 122 | ' ORDER BY gi.sortorder,gi.itemid DESC' 123 | ); 124 | while ($dbGraphItem = DBfetch($dbGraphItems)) { 125 | $graph->addItem( 126 | $dbGraphItem['itemid'], 127 | $dbGraphItem['yaxisside'], 128 | $dbGraphItem['calc_fnc'], 129 | $dbGraphItem['color'], 130 | $dbGraphItem['drawtype'], 131 | $dbGraphItem['type'] 132 | ); 133 | } 134 | 135 | $graph->draw(); 136 | 137 | require_once dirname(__FILE__).'/include/page_footer.php'; 138 | -------------------------------------------------------------------------------- /zabbix-2.2.x/big_graph.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zatree图形列表 6 | 7 | 8 | 14 | 17 | 68 | 69 | 70 | 71 | 97 |
    98 | 99 |
    100 | 101 | 102 | 103 | 104 | 105 |
    1小时  2小时  1天  2天  7天  30天  1年  2年
    106 |
    107 | 108 |
    109 |
    110 |
    111 | 112 | -------------------------------------------------------------------------------- /zabbix-2.2.x/left.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zabbix实例 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 21 |
      22 | 23 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /zabbix-2.2.x/page.class.php: -------------------------------------------------------------------------------- 1 | pageArray = $pagearray; 27 | 28 | if (count($params) > 0) { 29 | $this->initialize($params); 30 | } 31 | } 32 | 33 | function initialize($params) { 34 | 35 | if (count($params) > 0) { 36 | $this->total = isset($params['total']) ? intval($params['total']) : 0; //总条数 37 | $this->perpage = isset($params['perpage']) ? intval($params['perpage']) : 30; //每页条数 38 | $this->nowindex = isset($params['nowindex']) ? intval($params['nowindex']) : 1; //当前页 39 | $this->url = isset($params['url']) ? $params['url'] : ''; //url地址 40 | $this->next_page = isset($params['next_page']) ? $params['next_page'] : '下一页'; 41 | $this->pre_page = isset($params['pre_page']) ? $params['pre_page'] : '上一页'; 42 | $this->first_page = isset($params['first_page']) ? $params['first_page'] : '首页'; 43 | $this->last_page = isset($params['last_page']) ? $params['last_page'] : '末页'; 44 | $this->search_contion = isset($params['search_contion']) ? $params['search_contion'] : ''; 45 | $this->search_key = isset($params['searchkey']) ? $params['searchkey'] : ''; 46 | } 47 | $this->totalpage = ceil($this->total / $this->perpage); //总页数 48 | } 49 | 50 | /** 51 | * 获取显示"下一页"的代码 52 | * 53 | * @param string $style 54 | * @return string 55 | */ 56 | function next_page($style = 'pg_next') { 57 | if ($this->nowindex < $this->totalpage) { 58 | return $this->_get_link($this->_get_url($this->nowindex + 1), $this->next_page, $style); 59 | } 60 | return '' . $this->next_page . ''; 61 | } 62 | 63 | /** 64 | * 获取显示“上一页”的代码 65 | * 66 | * @param string $style 67 | * @return string 68 | */ 69 | function pre_page($style = 'pg_pre') { 70 | if ($this->nowindex > 1) { 71 | return $this->_get_link($this->_get_url($this->nowindex - 1), $this->pre_page, $style); 72 | } 73 | return '' . $this->pre_page . ''; 74 | } 75 | 76 | /** 77 | * 获取显示“首页”的代码 78 | * 79 | * @param string $style 80 | * @return string 81 | */ 82 | function first_page($style = 'pg_first') { 83 | if ($this->nowindex == 1) { 84 | return '' . $this->first_page . ''; 85 | } 86 | return $this->_get_link($this->_get_url(1), $this->first_page, $style); 87 | } 88 | 89 | /** 90 | * 获取显示“尾页”的代码 91 | * 92 | * @param string $style 93 | * @return string 94 | */ 95 | function last_page($style = 'pg_last') { 96 | if ($this->nowindex == $this->totalpage) { 97 | return '' . $this->last_page . ''; 98 | } 99 | return $this->_get_link($this->_get_url($this->totalpage), $this->last_page, $style); 100 | } 101 | 102 | /** 103 | * 获取显示“当前页”的代码 104 | * 105 | * @param string $style 106 | * @param string $nowindex_style 107 | * @return string 108 | */ 109 | function nowbar($style = 'pg_link', $nowindex_style = 'pg_curr') { 110 | $plus = $this->part; 111 | $begin = 1; 112 | $end = $this->totalpage; 113 | 114 | if ($this->nowindex > $plus) { 115 | $begin = $this->nowindex - $plus; 116 | $end = $this->nowindex + $plus; 117 | if ($end > $this->totalpage) { 118 | $begin = ($begin - $end + $this->totalpage > 0) ? ($begin - $end + $this->totalpage) : 1; 119 | $end = $this->totalpage; 120 | } 121 | } else { 122 | $begin = 1; 123 | $end = $begin + 2 * $plus; 124 | $end = $end > $this->totalpage ? $this->totalpage : $end; 125 | } 126 | $out = ''; 127 | for ($i = $begin; $i <= $end; $i++) { 128 | if ($i != $this->nowindex) { 129 | $out.= $this->_get_link($this->_get_url($i), $i, $style); 130 | } else { 131 | $out.= '' . $i . ''; 132 | } 133 | } 134 | 135 | return $out; 136 | } 137 | 138 | /** 139 | * 获取显示跳转按钮的代码 140 | * 141 | * @return string 142 | */ 143 | function select() { 144 | $out = ''; 153 | return $out; 154 | } 155 | 156 | /** 157 | * 控制分页显示风格 158 | * 159 | * @param int $mode 160 | * @return string 161 | */ 162 | function show($mode = 1) { 163 | switch ($mode) { 164 | case 1://上一页 1 2 3 4 5 下一页 第x页 165 | $start = ($this->nowindex - 1) * $this->perpage + 1; 166 | $end = $start + count($this->_get_result()) - 1; 167 | return '第' . $start . '条到' . $end . '条,共' . count($this->pageArray) . '条数据 ' . $this->pre_page() . $this->nowbar() . $this->next_page(); 168 | break; 169 | case 2://首页 上一页 1 2 3 4 5 下一页 末页 第x页 170 | return $this->first_page() . $this->pre_page() . $this->nowbar() . $this->next_page() . $this->last_page() . ' 第' . $this->select() . '页'; 171 | break; 172 | case 3://上一页 1 2 3 4 5 下一页 173 | return $this->pre_page() . $this->nowbar() . $this->next_page(); 174 | break; 175 | default://上一页 1 2 3 4 5 下一页 第x页 176 | return $this->pre_page() . $this->nowbar() . $this->next_page() . ' 第' . $this->select() . '页'; 177 | break; 178 | } 179 | } 180 | 181 | /* ----------------private function (私有方法)----------------------------------------------------------- */ 182 | 183 | /** 184 | * 为指定的页面返回地址值 185 | * 186 | * @param int $pagenum 187 | * @return string $url 188 | */ 189 | function _get_url($pagenum = 1) { 190 | return $this->url . '&page=' . $pagenum; 191 | } 192 | 193 | /** 194 | * 获取链接地址 195 | */ 196 | function _get_link($url, $text, $style = '') { 197 | $style = $style ? 'class="' . $style . '"' : ''; 198 | return '' . $text . ''; 199 | } 200 | 201 | /* 202 | * 获取当前页返回的数据 203 | * 204 | * */ 205 | 206 | function _get_result() { 207 | $_return = array(); 208 | $this->pageArray = array_values($this->pageArray); 209 | $start = ($this->nowindex - 1) * $this->perpage; 210 | $arrleng = count($this->pageArray); 211 | 212 | for ($i = $start; $i < ($start + $this->perpage); $i++) { 213 | if ($i >= $arrleng) 214 | break; 215 | array_push($_return, $this->pageArray[$i]); 216 | } 217 | 218 | return $_return; 219 | } 220 | 221 | } 222 | 223 | ?> 224 | -------------------------------------------------------------------------------- /zabbix-2.2.x/screenshots/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/screenshots/1.jpg -------------------------------------------------------------------------------- /zabbix-2.2.x/screenshots/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/screenshots/2.jpg -------------------------------------------------------------------------------- /zabbix-2.2.x/screenshots/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/screenshots/3.jpg -------------------------------------------------------------------------------- /zabbix-2.2.x/static/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/blank.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/static/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/fancybox_buttons.png -------------------------------------------------------------------------------- /zabbix-2.2.x/static/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/fancybox_loading.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/static/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/fancybox_overlay.png -------------------------------------------------------------------------------- /zabbix-2.2.x/static/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/fancybox_sprite.png -------------------------------------------------------------------------------- /zabbix-2.2.x/static/jquery.fancybox.min.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */ .fancybox-wrap,.fancybox-skin,.fancybox-outer,.fancybox-inner,.fancybox-image,.fancybox-wrap iframe,.fancybox-wrap object,.fancybox-nav,.fancybox-nav span,.fancybox-tmp{padding:0;margin:0;border:0;outline:0;vertical-align:top}.fancybox-wrap{position:absolute;top:0;left:0;z-index:8020}.fancybox-skin{position:relative;background:#f9f9f9;color:#444;text-shadow:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.fancybox-opened{z-index:8030}.fancybox-opened .fancybox-skin{-webkit-box-shadow:0 10px 25px rgba(0,0,0,.5);-moz-box-shadow:0 10px 25px rgba(0,0,0,.5);box-shadow:0 10px 25px rgba(0,0,0,.5)}.fancybox-outer,.fancybox-inner{position:relative}.fancybox-inner{overflow:hidden}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch}.fancybox-error{color:#444;font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;margin:0;padding:15px;white-space:nowrap}.fancybox-image,.fancybox-iframe{display:block;width:100%;height:100%}.fancybox-image{max-width:100%;max-height:100%}#fancybox-loading,.fancybox-close,.fancybox-prev span,.fancybox-next span{background-image:url(fancybox_sprite.png)}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:8060}#fancybox-loading div{width:44px;height:44px;background:url(fancybox_loading.gif) center center no-repeat}.fancybox-close{position:absolute;top:-18px;right:-18px;width:36px;height:36px;cursor:pointer;z-index:8040}.fancybox-nav{position:absolute;top:0;width:40%;height:100%;cursor:pointer;text-decoration:none;background:transparent url(blank.gif);-webkit-tap-highlight-color:rgba(0,0,0,0);z-index:8040}.fancybox-prev{left:0}.fancybox-next{right:0}.fancybox-nav span{position:absolute;top:50%;width:36px;height:34px;margin-top:-18px;cursor:pointer;z-index:8040;visibility:hidden}.fancybox-prev span{left:10px;background-position:0 -36px}.fancybox-next span{right:10px;background-position:0 -72px}.fancybox-nav:hover span{visibility:visible}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;visibility:hidden;max-width:99999px;max-height:99999px;overflow:visible!important}.fancybox-lock{overflow:hidden}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:8010;background:url(fancybox_overlay.png)}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll}.fancybox-title{visibility:hidden;font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;text-shadow:none;z-index:8050}.fancybox-opened .fancybox-title{visibility:visible}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-35px;z-index:8050;text-align:center}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:transparent;background:rgba(0,0,0,.8);-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;text-shadow:0 1px 2px #222;color:#FFF;font-weight:700;line-height:24px;white-space:nowrap}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff}.fancybox-title-inside-wrap{padding-top:10px}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8)} -------------------------------------------------------------------------------- /zabbix-2.2.x/static/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/line_conn.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/static/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/loading.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/static/page.css: -------------------------------------------------------------------------------- 1 | .page{ 2 | font-size: 12px; 3 | height: 30px; 4 | width: 1080px; 5 | text-align: right; 6 | } 7 | .pg_pre,.pg_next{ 8 | border: 1px solid #ccc; 9 | margin:0 3px; 10 | /* 11 | background-image: url("../image/icon_pg.gif"); 12 | */ 13 | background-repeat:no-repeat; 14 | } 15 | .pg_pre{ 16 | padding: 3px 8px 3px 20px; 17 | background-position:7px 3px; 18 | } 19 | a.pg_pre{ 20 | background-position:7px -19px; 21 | } 22 | .pg_next{ 23 | padding: 3px 20px 3px 8px; 24 | background-position:-22px 3px; 25 | } 26 | a.pg_next{ 27 | background-position:-22px -19px; 28 | } 29 | 30 | .pg_link{ 31 | padding: 3px 8px; 32 | margin:0 3px; 33 | border: 1px solid #ccc; 34 | } 35 | .pg_link:hover,a.pg_next:hover,a.pg_pre:hover{ 36 | border: 1px solid #A9C9E2; 37 | color: #137cce; 38 | } 39 | .pg_curr{ 40 | padding: 3px 8px; 41 | margin:0 3px; 42 | color: #137cce; 43 | background-color: #E8F5FE; 44 | border: 1px solid #A9C9E2; 45 | 46 | } 47 | .pg_select{ 48 | border:1px solid #ccc; 49 | padding:2px; 50 | margin:0 5px; 51 | } -------------------------------------------------------------------------------- /zabbix-2.2.x/static/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/zTreeStandard.gif -------------------------------------------------------------------------------- /zabbix-2.2.x/static/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.2.x/static/zTreeStandard.png -------------------------------------------------------------------------------- /zabbix-2.2.x/static/zTreeStyle.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style 3 | 4 | version: 3.4 5 | author: Hunter.z 6 | email: hunter.z@263.net 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | 11 | .ztree * {padding:0; margin:0; font-size:10px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} 12 | .ztree {margin:0; padding:1px; color:#333} 13 | .ztree li{padding:0; margin:0 0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} 14 | .ztree li ul{ margin:0; padding:0 0 0 12px} 15 | .ztree li ul.line{ background:url(line_conn.gif) 0 0 repeat-y;} 16 | 17 | .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; 18 | text-decoration:none; vertical-align:top; display: inline-block} 19 | .ztree li a:hover {text-decoration:underline} 20 | .ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 21 | .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 22 | .ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; 23 | opacity:0.8; filter:alpha(opacity=80)} 24 | .ztree li a.tmpTargetNode_prev {} 25 | .ztree li a.tmpTargetNode_next {} 26 | .ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; 27 | font-size:12px; border:1px #7EC4CC solid; *border:0px} 28 | .ztree li span {line-height:16px; margin-right:2px} 29 | .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; 30 | border:0 none; cursor: pointer;outline:none; 31 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 32 | background-image:url("zTreeStandard.png"); *background-image:url("zTreeStandard.gif")} 33 | 34 | .ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} 35 | .ztree li span.button.chk.checkbox_false_full {background-position:0 0} 36 | .ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} 37 | .ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} 38 | .ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} 39 | .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} 40 | .ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} 41 | .ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} 42 | .ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} 43 | .ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} 44 | .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} 45 | .ztree li span.button.chk.radio_false_full {background-position:-28px 0} 46 | .ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} 47 | .ztree li span.button.chk.radio_false_part {background-position:-28px -28px} 48 | .ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} 49 | .ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} 50 | .ztree li span.button.chk.radio_true_full {background-position:-42px 0} 51 | .ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} 52 | .ztree li span.button.chk.radio_true_part {background-position:-42px -28px} 53 | .ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} 54 | .ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} 55 | 56 | .ztree li span.button.switch {width:14px; height:18px} 57 | .ztree li span.button.root_open{background-position:-92px -54px} 58 | .ztree li span.button.root_close{background-position:-74px -54px} 59 | .ztree li span.button.roots_open{background-position:-92px 0} 60 | .ztree li span.button.roots_close{background-position:-74px 0} 61 | .ztree li span.button.center_open{background-position:-92px -18px} 62 | .ztree li span.button.center_close{background-position:-74px -18px} 63 | .ztree li span.button.bottom_open{background-position:-92px -36px} 64 | .ztree li span.button.bottom_close{background-position:-74px -36px} 65 | .ztree li span.button.noline_open{background-position:-92px -72px} 66 | .ztree li span.button.noline_close{background-position:-74px -72px} 67 | .ztree li span.button.root_docu{ background:none;} 68 | .ztree li span.button.roots_docu{background-position:-56px 0} 69 | .ztree li span.button.center_docu{background-position:-56px -18px} 70 | .ztree li span.button.bottom_docu{background-position:-56px -36px} 71 | .ztree li span.button.noline_docu{ background:none;} 72 | 73 | .ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} 74 | .ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} 75 | .ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} 76 | .ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} 77 | .ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} 78 | 79 | .ztree li span.button.ico_loading{margin-right:2px; background:url(loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} 80 | 81 | ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} 82 | 83 | span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; 84 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 85 | background-position:-110px -80px; background-image:url("zTreeStandard.png"); *background-image:url("zTreeStandard.gif")} 86 | 87 | ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} 88 | .zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} 89 | .ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle} 90 | /* 91 | div#rMenu {position:absolute; visibility:hidden; top:0; background-color: #555;text-align: left;padding: 2px;} 92 | div#rMenu ul li{ 93 | margin: 1px 0; 94 | padding: 0 5px; 95 | cursor: pointer; 96 | list-style: none outside none; 97 | background-color: #DFDFDF; 98 | } 99 | */ 100 | 101 | /* level style*/ 102 | /*.ztree li span.button.level0 { 103 | display:none; 104 | } 105 | .ztree li ul.level0 { 106 | padding:0; 107 | background:none; 108 | }*/ -------------------------------------------------------------------------------- /zabbix-2.2.x/static/ztreedemo.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, th { 4 | margin: 0;padding: 0;border: 0;outline: 0;font-weight: inherit;font-style: inherit;font-size: 100%;font-family: inherit;vertical-align: baseline;}*/ 5 | 6 | 7 | body {color: #2f332a;font: 15px/21px Arial, Helvetica, simsun, sans-serif;background: #f0f6e4 \9;} 8 | h1, h2, h3, h4, h5, h6 {color: #2f332a;font-weight: bold;font-family: Helvetica, Arial, sans-serif;padding-bottom: 5px;} 9 | h1 {font-size: 24px;line-height: 34px;text-align: center;} 10 | h2 {font-size: 14px;line-height: 24px;padding-top: 5px;} 11 | h6 {font-weight: normal;font-size: 12px;letter-spacing: 1px;line-height: 24px;text-align: center;} 12 | a {color:#3C6E31;text-decoration: underline;} 13 | a:hover {color:white;} 14 | input.radio {margin: 0 2px 0 8px;} 15 | input.radio.first {margin-left:0;} 16 | input.empty {color: lightgray;} 17 | code {color: #2f332a;} 18 | .highlight_red {color:#A60000;} 19 | .highlight_green {color:#A7F43D;} 20 | li {list-style: circle;font-size: 12px;} 21 | li.title {list-style: none;} 22 | ul.list {margin-left: 17px;} 23 | 24 | div.content_wrap {width: 600px;height:380px;} 25 | div.content_wrap div.left{float: left;width: 250px;} 26 | div.content_wrap div.right{float: right;width: 340px;} 27 | div.zTreeDemoBackground {width:250px;height:362px;text-align:left;} 28 | 29 | ul.ztree { 30 | color: #333333; 31 | margin: 0; 32 | padding: 0; 33 | } 34 | ul.log {border: 1px solid #617775;background: #f0f6e4;width:300px;height:170px;overflow: hidden;} 35 | ul.log.small {height:45px;} 36 | ul.log li {color: #666666;list-style: none;padding-left: 10px;} 37 | ul.log li.dark {background-color: #E3E3E3;} 38 | 39 | /* ruler */ 40 | div.ruler {height:20px; width:220px; background-color:#f0f6e4;border: 1px solid #333; margin-bottom: 5px; cursor: pointer} 41 | div.ruler div.cursor {height:20px; width:30px; background-color:#3C6E31; color:white; text-align: right; padding-right: 5px; cursor: pointer} -------------------------------------------------------------------------------- /zabbix-2.2.x/zabbix.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | zabbix zatree 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | <body> 14 | </body> 15 | -------------------------------------------------------------------------------- /zabbix-2.2.x/zabbix_ajax.php: -------------------------------------------------------------------------------- 1 | 3600, '2hour' => 7200, '1days' => 3600 * 24, '2days' => 3600 * 48, '7days' => 3600 * 24 * 7, '30days' => 3600 * 24 * 30, '1years' => 3600 * 24 * 365, '2years' => 3600 * 24 * 365 * 2); 21 | $changeType = $_POST['changeType']; 22 | $endTime = time(); 23 | $beginTime = $endTime - $changedayList[$changeType]; 24 | 25 | echo "{endTime:" . json_encode(date("Y-m-d H:i:s", $endTime)) . ",beginTime:" . json_encode(date("Y-m-d H:i:s", $beginTime)) . "}"; 26 | exit; 27 | } 28 | 29 | 30 | 31 | global $zabbix_api_config; 32 | 33 | $url_http = dirname(dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"])); 34 | 35 | $zabbixApi = new ZabbixApi($url_http . '/' . trim($zabbix_api_config['api_url']), trim($zabbix_api_config['user']), trim($zabbix_api_config['passowrd'])); 36 | $groupid = isset($_GET["groupid"]) ? $_GET["groupid"] : 0; 37 | 38 | if ($groupid > 0) { 39 | //根据分组id查询分组下的机器 40 | $hosts = $zabbixApi->hostGet(array("output" => "extend", "monitored_hosts" => true, "groupids" => array($groupid), "sortfield" => array("host"), "sortorder" => array("ASC"))); 41 | $new_list = array(); 42 | foreach ($hosts as $each_host) { 43 | //$new_list[ip2long($each_host->host)]=$each_host; 44 | $new_list[] = $each_host; 45 | } 46 | ksort($new_list); 47 | foreach ($new_list as &$each_host_new) { 48 | $each_host_new->target = 'rightFrame'; 49 | $each_host_new->groupids = $groupid; 50 | $each_host_new->url = 'graph.php?hostid=' . $each_host_new->hostid; 51 | } 52 | echo json_encode(array_values($new_list)); 53 | } else { 54 | //查询所有的分组列表 55 | $groups = $zabbixApi->hostgroupGet(array("output" => "extend", "monitored_hosts" => true, "sortfield"=>"name")); 56 | foreach ($groups as &$each) { 57 | $each->id = $each->groupid; 58 | $each->isParent = true; 59 | $each->target = 'rightFrame'; 60 | $each->url = 'graph.php?group_class=' . $each->groupid; 61 | 62 | //查询下面有多少机器 63 | $hosts = $zabbixApi->hostGet(array("output" => "extend", "monitored_hosts" => true, "groupids" => array($each->groupid))); 64 | $each->name = $each->name . '(' . count($hosts) . ')'; 65 | } 66 | echo json_encode($groups); 67 | } 68 | } 69 | ?> -------------------------------------------------------------------------------- /zabbix-2.2.x/zabbix_config.php: -------------------------------------------------------------------------------- 1 | 'api_jsonrpc.php', 6 | 'user'=>'admin', 7 | 'passowrd'=>'xxxxx', 8 | 'graph_url'=>'zabbix_chart.php', 9 | ); 10 | 11 | ?> 12 | -------------------------------------------------------------------------------- /zabbix-2.4.5/README.md: -------------------------------------------------------------------------------- 1 | 2 | Zatree for zabbix 2.4.5 安装 3 | ================================== 4 | 5 | 1:下载文件 6 | 7 | git clone https://github.com/spide4k/zatree.git zatree 8 | 9 | 2:为了减少编辑文件带来的误操作,以后zatree只提供和zabbix整合好的包 10 | 11 | php需要支持php-xml、php-gd、php-mysql 12 | 13 | 先备份当前zabbix web目录并挪走,然后解压zatree-zabbix-2.4.5.tar.gz,然后修改以下两个文件 14 | 15 | 3:zabbix数据库 16 | 拷贝源目录的conf/zabbix.conf.php到新目录覆盖 17 | 18 | 如果原来有添加字体也顺手拷贝过来 19 | 20 | 4:支持web interface,修改配置文件 21 | zatree/zabbix_config.php 22 | 23 | 'user'=>'xxx', //web登陆的用户名 24 | 25 | 'password'=>'xxx', //web登陆的密码 26 | 27 | 'http_user'=>'xxx', //httpsweb登陆的用户名 28 | 29 | 'http_password'=>'xxx', //httpsweb登陆的密码 30 | 31 | 32 | 常见问题 33 | ================================== 34 | 35 | 1:如何排错? 36 | 37 | 可以打开php的显示错误,看看什么原因 38 | 39 | vi /etc/php.ini 40 | 41 | display_errors = On 42 | 43 | 重启web server,然后监控web日志 44 | 45 | 2:Fatal error: Call to undefined function json_encode() in /var/www/html/zabbix/zatree/ZabbixApiAbstract.class.php on line 220 46 | 47 | 需要php encode支持 48 | 49 | yum install php-pecl-json 50 | 51 | 如果上面这个方法不行,找不到php-pecl-json,试试下面这个方法 52 | 53 | yum install php-pear 54 | 55 | pecl install json 56 | 57 | echo "extension=json.so" > /etc/php.d/json.ini 58 | 59 | 3:如果右侧显示一行2个图,说明你分辨率不够,叫老板给你换个机器,或者修改graph.php文件这行的width值 60 | 61 | 181 62 | 63 | 4:报以下错误 64 | 65 | Warning: array_key_exists() expects parameter 2 to be array, null given in zatree/ZabbixApiAbstract.class.php on line 255 66 | 67 | Notice: Trying to get property of non-object in zatree/ZabbixApiAbstract.class.php on line 262 68 | 69 | Warning: Invalid argument supplied for foreach() in zatree/graph.php online 130 70 | 71 | 内存溢出,修改php.ini调整大小为XXX 72 | memory_limit = XXXM 73 | 74 | 5:是否支持搜索多个关键字? 75 | 76 | 支持,关键字用逗号分隔 77 | 78 | 6:搜索选项的差值是什么意思? 79 | 80 | 在一段时间里,最大值减去最小值得到一个结果,然后用这个结果排序,这个选项对一段时间内的突发增长查看非常有用 81 | 82 | 7: 如果你的主机名都是ip,并且向排序显示,解决方法: 编辑zabbix_ajax.php 83 | 84 | 43行代码注释44打开,不支持ip排序,43行代码打开44行注释,支持ip排序 85 | 43 $new_list[ip2long($each_host->host)]=$each_host; 86 | 44 //$new_list[] = $each_host; 87 | 88 | 8: 如果zabbix是2.2.1版本,有可能会报 89 | 90 | Call to undefined method CMacrosResolverHelper::resolveItemNames() in zabbix/include/classes/api/CLineGraphDraw_Zabbix.php on line 107 91 | 解决方法:升级zabbix > 2.2.1 92 | 93 | -------------------------------------------------------------------------------- /zabbix-2.4.5/zatree-zabbix-2.4.5.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-2.4.5/zatree-zabbix-2.4.5.tar.gz -------------------------------------------------------------------------------- /zabbix-3.0.x/README.md: -------------------------------------------------------------------------------- 1 | 2 | Zatree for zabbix 3.0.x 安装 3 | ================================== 4 | ##【目录】 5 | ---- 6 | 7 | [0 zatree3.0.x 快速部署方法](#0) 8 | [1 zatree3.0.x 实现原理](#1) 9 | ........[1.1 zabbix 菜单上显示zatree ](#1.1) 10 | ........[1.2 点击dash上zatree跳转到zatree界面 ](#1.2) 11 | [2 zatree3.0.x 常见问题及处理方法](#0) 12 | [3 版本发布 ](#1) 13 | 14 | ##【正文】 15 | ---- 16 | 17 |

      zatree3.0.x 快速部署方法

      18 | 19 | 部署方法很简单 20 | 21 | ``` 22 | git clone https://github.com/BillWang139967/zatree.git 23 | cd cd zatree/zabbix-3.0.x/ 24 | sh start.sh 25 | ``` 26 | 执行过程中需要输入zabbix admin的账号和密码 27 | 28 | ![image](https://raw.github.com/BillWang139967/zatree/master/zabbix-3.0.x/images/install.jpg) 29 | 30 |

      zatree3.0.x 实现原理

      31 | 32 | 假如zabbix web目录位置在/data/web/zabbix,定义zabbix目录 33 | 34 | ZABBIX_PATH=/data/web/zabbix 35 | 36 |

      1.1 zabbix 菜单上显示zatree

      37 | 38 | 导航增加Zatree入口,修改menu.inc.php,main.js 39 | 40 | $ZABBIX_PATH/include/menu.inc.php 41 | 42 | 在302行插入如下内容 43 | 44 | ``` 45 | 'zatree'=> [ 46 | 'label' => _('Zatree'), 47 | 'user_type' => USER_TYPE_ZABBIX_USER, 48 | 'default_page_id' => 0, 49 | //'force_disable_all_nodes' => true, 50 | 'pages' => [ 51 | [ 52 | 'url' => 'zabbix_tree.php', 53 | 'label' => _('zatree') 54 | ], 55 | ] 56 | 57 | ], 58 | 59 | ``` 60 | 替换$ZABBIX_PATH/js/main.js 104行内容 61 | ``` 62 | menus: {'view': 0, 'cm': 0, 'reports': 0, 'config': 0, 'admin': 0,'zatree':0}, 63 | ``` 64 |

      1.2 点击dash上zatree跳转到zatree界面

      65 | 66 | 在上一步骤zatree指向的文件为$ZABBIX_PATH/zabbix_tree.php 文件 67 | 68 | 故将zabbix_tree.php文件放到$ZABBIX_PATH目录 69 | 70 |

      2 常见问题及处理方法

      71 | 72 | 1:如何排错? 73 | 74 | 可以打开php的显示错误,看看什么原因 75 | 76 | vi /etc/php.ini 77 | ``` 78 | display_errors = On 79 | ``` 80 | 重启web server,然后监控web日志 81 | 82 | 2:如果右侧显示一行2个图,说明你分辨率不够,叫老板给你换个机器,或者修改graph.php文件这行的width值 83 | 84 | ``` 85 | 181 86 | ``` 87 | 3:报以下错误 88 | 89 | Warning: array_key_exists() expects parameter 2 to be array, null given in zatree/ZabbixApiAbstract.class.php on line 255 90 | 91 | Notice: Trying to get property of non-object in zatree/ZabbixApiAbstract.class.php on line 262 92 | 93 | Warning: Invalid argument supplied for foreach() in zatree/graph.php online 130 94 | 95 | 内存溢出,修改php.ini调整大小为XXX 96 | ``` 97 | memory_limit = XXXM 98 | ``` 99 | 4:是否支持搜索多个关键字? 100 | 101 | 支持,关键字用逗号分隔 102 | 103 | 5:搜索选项的差值是什么意思? 104 | 105 | 在一段时间里,最大值减去最小值得到一个结果,然后用这个结果排序,这个选项对一段时间内的突发增长查看非常有用 106 | 107 | 6: 如果你的主机名都是ip,并且向排序显示,解决方法: 编辑zabbix_ajax.php 108 | 109 | 43行代码注释44打开,不支持ip排序,43行代码打开44行注释,支持ip排序 110 | ``` 111 | 43 $new_list[ip2long($each_host->host)]=$each_host; 112 | 44 //$new_list[] = $each_host; 113 | ``` 114 |

      3 版本发布

      115 | ---- 116 | * v3.0.1,2016-06-05,新增。发布初始版本。 117 | 118 | -------------------------------------------------------------------------------- /zabbix-3.0.x/images/install.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-3.0.x/images/install.jpg -------------------------------------------------------------------------------- /zabbix-3.0.x/start.sh: -------------------------------------------------------------------------------- 1 | ######################################################################### 2 | # File Name: start.sh 3 | # Author: Bill 4 | # mail: XXXXXXX@qq.com 5 | # Created Time: 2016-06-05 10:44:20 6 | ######################################################################### 7 | #!/bin/bash 8 | WEB_DIR=`find / -name zabbix | grep web` 9 | if [[ -z ${WEB_DIR} ]] 10 | then 11 | echo "not find the zabbix web dir" 12 | exit 1 13 | fi 14 | cp -rf ${WEB_DIR} ${WEB_DIR}_bak 15 | tar -zxf zatree.tar.gz -C ${WEB_DIR} 16 | # 导航增加Zatree入口 17 | cp ${WEB_DIR}/zatree/addfile/menu.inc.php ${WEB_DIR}/include/menu.inc.php 18 | cp ${WEB_DIR}/zatree/addfile/main.js ${WEB_DIR}/js/main.js 19 | 20 | cp ${WEB_DIR}/zatree/addfile/zabbix_tree.php ${WEB_DIR}/ 21 | 22 | cp ${WEB_DIR}/zatree/addfile/API.php ${WEB_DIR}/include/classes/api/ 23 | cp ${WEB_DIR}/zatree/addfile/CApiServiceFactory.php ${WEB_DIR}/include/classes/api/ 24 | cp ${WEB_DIR}/zatree/addfile/CItemValue.php ${WEB_DIR}/include/classes/api/services/ 25 | 26 | read -p "please input zabbix admin_name(default:admin) ?:" g_ZABBIX_USER 27 | g_ZABBIX_USER=${g_ZABBIX_USER:-admin} 28 | read -p "please input zabbix admin_password(default:zabbix) ?:" g_ZABBIX_PASS 29 | g_ZABBIX_PASS=${g_ZABBIX_PASS:-zabbix} 30 | sed -i "s/ZABBIX_USER/${g_ZABBIX_USER}/g" ${WEB_DIR}/zatree/zabbix_config.php 31 | sed -i "s/ZABBIX_PASS/${g_ZABBIX_PASS}/g" ${WEB_DIR}/zatree/zabbix_config.php 32 | -------------------------------------------------------------------------------- /zabbix-3.0.x/zatree.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meetbill/zatree/e24bdf76c42354ce8541bf22e492df4b83043118/zabbix-3.0.x/zatree.tar.gz --------------------------------------------------------------------------------