├── README.md ├── monitor-js └── monitor │ ├── .babelrc │ ├── .editorconfig │ ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── vendor-manifest.json │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── webpack.dll.conf.js │ └── webpack.prod.conf.js │ ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js │ ├── dist │ ├── index.html │ └── static │ │ ├── css │ │ ├── app.e15b1a24ead26f7fb6a519071434b0ac.css │ │ ├── color-dark.css │ │ ├── datasource.css │ │ ├── main.css │ │ └── theme-green │ │ │ ├── color-green.css │ │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ │ └── index.css │ │ ├── fonts │ │ ├── element-icons.b02bdc1.ttf │ │ ├── ionicons.05acfdb.woff │ │ ├── ionicons.24712f6.ttf │ │ └── ionicons.2c2ae06.eot │ │ ├── img │ │ ├── img.2aab7b4.jpg │ │ ├── img.jpg │ │ ├── ionicons.621bd38.svg │ │ ├── mongo.png │ │ ├── mysql.jpg │ │ ├── mysql.png │ │ ├── oracle.jpg │ │ ├── oracle2.jpg │ │ ├── redis.png │ │ ├── sky.871d198.jpg │ │ ├── sky.jpg │ │ └── tomcat.png │ │ └── js │ │ ├── 0.4836f94b3c25f7f992e3.js │ │ ├── 1.269db91223aa48581007.js │ │ ├── 10.3c94d0ce99750029007d.js │ │ ├── 2.3718d03cb51d88bed961.js │ │ ├── 3.7632ff7f84ce45135057.js │ │ ├── 4.2ce27a84f4096be5efd9.js │ │ ├── 5.8ae6def9f84bae569d13.js │ │ ├── 6.b357ea7e4e3b31339fc0.js │ │ ├── 7.8e696a4810aeb4671176.js │ │ ├── 8.ae3c3977d35e9442b5f7.js │ │ ├── 9.fdc8115edcaa2f1af9bf.js │ │ ├── app.9425fc1552b0f9aa8816.js │ │ ├── manifest.621479a60060fb67cd16.js │ │ ├── vendor.0c44bbcb2dc81d18e2ab.js │ │ └── vendor.dll.js │ ├── index.html │ ├── package.json │ ├── screenshots │ ├── wms1.png │ └── wms2.png │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── common │ │ │ ├── ChinaMap.vue │ │ │ ├── Cpu.vue │ │ │ ├── Disk.vue │ │ │ ├── EventTable.vue │ │ │ ├── Header.vue │ │ │ ├── Home.vue │ │ │ ├── Memory.vue │ │ │ ├── ServiceChart.vue │ │ │ └── Sidebar.vue │ │ └── page │ │ │ ├── Agent.vue │ │ │ ├── ApacheMonitor.vue │ │ │ ├── Dashboard.vue │ │ │ ├── Events.vue │ │ │ ├── FTPMonitor.vue │ │ │ ├── Host.vue │ │ │ ├── HostDetail.vue │ │ │ ├── HostGroup.vue │ │ │ ├── HostGroupCircle.vue │ │ │ ├── Login.vue │ │ │ └── WaterFall.vue │ ├── main.js │ └── router │ │ └── index.js │ └── static │ ├── .gitkeep │ ├── css │ ├── color-dark.css │ ├── datasource.css │ ├── main.css │ └── theme-green │ │ ├── color-green.css │ │ ├── fonts │ │ ├── element-icons.ttf │ │ └── element-icons.woff │ │ └── index.css │ ├── img │ ├── img.jpg │ ├── mongo.png │ ├── mysql.jpg │ ├── mysql.png │ ├── oracle.jpg │ ├── oracle2.jpg │ ├── redis.png │ ├── sky.jpg │ └── tomcat.png │ └── js │ └── vendor.dll.js ├── monitor-py └── monitor │ ├── .idea │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ ├── monitor.iml │ └── workspace.xml │ ├── api │ ├── __init__.py │ ├── __init__.pyc │ ├── admin.py │ ├── admin.pyc │ ├── agent_view.py │ ├── agent_view.pyc │ ├── apps.py │ ├── apps.pyc │ ├── migrations │ │ ├── __init__.py │ │ └── __init__.pyc │ ├── models.py │ ├── models.pyc │ ├── playbook.py │ ├── src │ │ ├── CentOS-Media.repo │ │ └── zabbix_agentd.conf │ ├── tests.py │ ├── urls.py │ ├── urls.pyc │ ├── views.py │ ├── views.pyc │ ├── zabbix-demo.py │ ├── zabbix-usage-demo.py │ ├── zabbix.py │ └── zabbix.pyc │ ├── db.sqlite3 │ ├── disk_search.py │ ├── host.yaml │ ├── manage.py │ ├── monitor │ ├── __init__.py │ ├── __init__.pyc │ ├── settings.py │ ├── settings.pyc │ ├── urls.py │ ├── urls.pyc │ ├── views.py │ ├── views.pyc │ ├── wsgi.py │ └── wsgi.pyc │ ├── start.sh │ ├── static │ ├── index.html │ └── static │ │ ├── css │ │ ├── app.e15b1a24ead26f7fb6a519071434b0ac.css │ │ ├── color-dark.css │ │ ├── datasource.css │ │ ├── main.css │ │ └── theme-green │ │ │ ├── color-green.css │ │ │ ├── fonts │ │ │ ├── element-icons.ttf │ │ │ └── element-icons.woff │ │ │ └── index.css │ │ ├── fonts │ │ ├── element-icons.b02bdc1.ttf │ │ ├── ionicons.05acfdb.woff │ │ ├── ionicons.24712f6.ttf │ │ └── ionicons.2c2ae06.eot │ │ ├── img │ │ ├── img.2aab7b4.jpg │ │ ├── img.jpg │ │ ├── ionicons.621bd38.svg │ │ ├── mongo.png │ │ ├── mysql.jpg │ │ ├── mysql.png │ │ ├── oracle.jpg │ │ ├── oracle2.jpg │ │ ├── redis.png │ │ ├── sky.871d198.jpg │ │ ├── sky.jpg │ │ └── tomcat.png │ │ └── js │ │ ├── 0.4836f94b3c25f7f992e3.js │ │ ├── 1.269db91223aa48581007.js │ │ ├── 10.3c94d0ce99750029007d.js │ │ ├── 2.3718d03cb51d88bed961.js │ │ ├── 3.7632ff7f84ce45135057.js │ │ ├── 4.2ce27a84f4096be5efd9.js │ │ ├── 5.8ae6def9f84bae569d13.js │ │ ├── 6.b357ea7e4e3b31339fc0.js │ │ ├── 7.8e696a4810aeb4671176.js │ │ ├── 8.ae3c3977d35e9442b5f7.js │ │ ├── 9.fdc8115edcaa2f1af9bf.js │ │ ├── app.9425fc1552b0f9aa8816.js │ │ ├── manifest.621479a60060fb67cd16.js │ │ ├── vendor.0c44bbcb2dc81d18e2ab.js │ │ └── vendor.dll.js │ └── templates │ └── index.html ├── pic └── pic │ ├── agent-deploy.png │ ├── apache.png │ ├── dashboard.png │ ├── dashboard1.png │ ├── dashboard2.png │ ├── event.png │ ├── group.png │ ├── host-detail1.png │ ├── host-detail2.png │ ├── host-detail3.png │ ├── host-detail4.png │ ├── host.png │ ├── login.png │ └── rest-api.png └── 部署文档.md /README.md: -------------------------------------------------------------------------------- 1 | # zabbix-monitor 2 | - 基于 zabbix API 实现的监控系统,前端采用Vue + ElementUI,后端采用django+pyzabbix. 3 | 4 | ## 功能简介 5 | 6 | ### 登录页 7 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/login.png) 8 | 9 | ### 仪表盘 10 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/dashboard1.png) 11 | 12 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/dashboard2.png) 13 | 14 | 15 | ### 主机组 16 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/group.png) 17 | 18 | ### 主机列表 19 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/host.png) 20 | 21 | ### 主机详情 22 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/host-detail1.png) 23 | 24 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/host-detail2.png) 25 | 26 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/host-detail3.png) 27 | 28 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/host-detail4.png) 29 | 30 | ### 告警事件 31 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/event.png) 32 | 33 | ### 应用监控 34 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/apache.png) 35 | 36 | ### 监控系统REST API swagger 文档 37 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/rest-api.png) 38 | 39 | ### zabbix agent自动化部署 40 | ![image](https://github.com/huangll99/zabbix-monitor/blob/master/pic/pic/agent-deploy.png) 41 | -------------------------------------------------------------------------------- /monitor-js/monitor/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["es2015", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": ["transform-runtime"], 7 | "comments": false, 8 | "env": { 9 | "test": { 10 | "plugins": [ "istanbul" ] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /monitor-js/monitor/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | var ora = require('ora') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var shell = require('shelljs') 10 | var webpack = require('webpack') 11 | var config = require('../config') 12 | var webpackConfig = require('./webpack.prod.conf') 13 | 14 | var spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 18 | shell.rm('-rf', assetsPath) 19 | shell.mkdir('-p', assetsPath) 20 | shell.config.silent = true 21 | shell.cp('-R', 'static/*', assetsPath) 22 | shell.config.silent = false 23 | 24 | webpack(webpackConfig, function (err, stats) { 25 | spinner.stop() 26 | if (err) throw err 27 | process.stdout.write(stats.toString({ 28 | colors: true, 29 | modules: false, 30 | children: false, 31 | chunks: false, 32 | chunkModules: false 33 | }) + '\n\n') 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var chalk = require('chalk') 2 | var semver = require('semver') 3 | var packageConfig = require('../package.json') 4 | 5 | function exec (cmd) { 6 | return require('child_process').execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | var config = require('../config') 4 | if (!process.env.NODE_ENV) { 5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 6 | } 7 | 8 | var opn = require('opn') 9 | var path = require('path') 10 | var express = require('express') 11 | var webpack = require('webpack') 12 | var proxyMiddleware = require('http-proxy-middleware') 13 | var webpackConfig = require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | var proxyTable = config.dev.proxyTable 22 | 23 | var app = express() 24 | var compiler = webpack(webpackConfig) 25 | 26 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | quiet: true 29 | }) 30 | 31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 32 | log: () => {} 33 | }) 34 | // force page reload when html-webpack-plugin template changes 35 | compiler.plugin('compilation', function (compilation) { 36 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 37 | hotMiddleware.publish({ action: 'reload' }) 38 | cb() 39 | }) 40 | }) 41 | 42 | // proxy api requests 43 | Object.keys(proxyTable).forEach(function (context) { 44 | var options = proxyTable[context] 45 | if (typeof options === 'string') { 46 | options = { target: options } 47 | } 48 | app.use(proxyMiddleware(options.filter || context, options)) 49 | }) 50 | 51 | // handle fallback for HTML5 history API 52 | app.use(require('connect-history-api-fallback')()) 53 | 54 | // serve webpack bundle output 55 | app.use(devMiddleware) 56 | 57 | // enable hot-reload and state-preserving 58 | // compilation error display 59 | app.use(hotMiddleware) 60 | 61 | // serve pure static assets 62 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 63 | app.use(staticPath, express.static('./static')) 64 | 65 | var uri = 'http://localhost:' + port 66 | 67 | devMiddleware.waitUntilValid(function () { 68 | console.log('> Listening at ' + uri + '\n') 69 | }) 70 | 71 | module.exports = app.listen(port, function (err) { 72 | if (err) { 73 | console.log(err) 74 | return 75 | } 76 | 77 | // when env is testing, don't need open it 78 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 79 | opn(uri) 80 | } 81 | }) 82 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract({ 32 | use: sourceLoader, 33 | fallback: 'vue-style-loader' 34 | }) 35 | } else { 36 | return ['vue-style-loader', sourceLoader].join('!') 37 | } 38 | } 39 | 40 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 41 | return { 42 | css: generateLoaders(['css']), 43 | postcss: generateLoaders(['css']), 44 | less: generateLoaders(['css', 'less']), 45 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 46 | scss: generateLoaders(['css', 'sass']), 47 | stylus: generateLoaders(['css', 'stylus']), 48 | styl: generateLoaders(['css', 'stylus']) 49 | } 50 | } 51 | 52 | // Generate loaders for standalone style files (outside of .vue) 53 | exports.styleLoaders = function (options) { 54 | var output = [] 55 | var loaders = exports.cssLoaders(options) 56 | for (var extension in loaders) { 57 | var loader = loaders[extension] 58 | output.push({ 59 | test: new RegExp('\\.' + extension + '$'), 60 | loader: loader 61 | }) 62 | } 63 | return output 64 | } 65 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | loaders: utils.cssLoaders({ 7 | sourceMap: isProduction 8 | ? config.build.productionSourceMap 9 | : config.dev.cssSourceMap, 10 | extract: isProduction 11 | }), 12 | postcss: [ 13 | require('autoprefixer')({ 14 | browsers: ['last 2 versions'] 15 | }) 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var webpack = require('webpack') 4 | var config = require('../config') 5 | 6 | function resolve (dir) { 7 | return path.join(__dirname, '..', dir) 8 | } 9 | 10 | module.exports = { 11 | entry: { 12 | app: ['babel-polyfill','./src/main.js'] 13 | }, 14 | output: { 15 | path: config.build.assetsRoot, 16 | filename: '[name].js', 17 | publicPath: process.env.NODE_ENV === 'production' 18 | ? config.build.assetsPublicPath 19 | : config.dev.assetsPublicPath 20 | }, 21 | resolve: { 22 | extensions: ['.js', '.vue', '.json'], 23 | modules: [ 24 | resolve('src'), 25 | resolve('node_modules') 26 | ], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.common.js', 29 | 'src': resolve('src'), 30 | 'assets': resolve('src/assets'), 31 | 'components': resolve('src/components') 32 | } 33 | }, 34 | module: { 35 | rules: [ 36 | { 37 | test: /\.vue$/, 38 | loader: 'vue-loader' 39 | }, 40 | { 41 | test: /\.js$/, 42 | loader: 'babel-loader', 43 | include: [resolve('src'), resolve('test'),resolve('/node_modules/vue-particles')] 44 | }, 45 | { 46 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 47 | loader: 'url-loader', 48 | query: { 49 | limit: 10000, 50 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 51 | } 52 | }, 53 | { 54 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 55 | loader: 'url-loader', 56 | query: { 57 | limit: 10000, 58 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 59 | } 60 | } 61 | ] 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var webpack = require('webpack') 3 | var config = require('../config') 4 | var merge = require('webpack-merge') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 8 | 9 | // add hot-reload related code to entry chunks 10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 12 | }) 13 | 14 | module.exports = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: '#cheap-module-eval-source-map', 20 | plugins: [ 21 | new webpack.DefinePlugin({ 22 | 'process.env': config.dev.env 23 | }), 24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoEmitOnErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }), 33 | new FriendlyErrorsPlugin() 34 | ] 35 | }) 36 | -------------------------------------------------------------------------------- /monitor-js/monitor/build/webpack.dll.conf.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | 4 | module.exports = { 5 | entry: { 6 | vendor: ['vue/dist/vue.common.js','vue-router', 'babel-polyfill','axios'] 7 | }, 8 | output: { 9 | path: path.join(__dirname, '../static/js'), 10 | filename: '[name].dll.js', 11 | library: '[name]_library' 12 | }, 13 | plugins: [ 14 | new webpack.DllPlugin({ 15 | path: path.join(__dirname, '.', '[name]-manifest.json'), 16 | name: '[name]_library' 17 | }), 18 | new webpack.optimize.UglifyJsPlugin({ 19 | compress: { 20 | warnings: false 21 | } 22 | }), 23 | new webpack.DefinePlugin({ 24 | 'process.env': { 25 | NODE_ENV: '"production"' 26 | } 27 | }) 28 | ] 29 | }; -------------------------------------------------------------------------------- /monitor-js/monitor/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var webpack = require('webpack') 4 | var config = require('../config') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var HtmlWebpackPlugin = require('html-webpack-plugin') 8 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 9 | var env = config.build.env 10 | 11 | var webpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | rules: utils.styleLoaders({ 14 | sourceMap: config.build.productionSourceMap, 15 | extract: true 16 | }) 17 | }, 18 | devtool: config.build.productionSourceMap ? '#source-map' : false, 19 | output: { 20 | path: config.build.assetsRoot, 21 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 22 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 23 | }, 24 | plugins: [ 25 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 26 | new webpack.DefinePlugin({ 27 | 'process.env': env 28 | }), 29 | new webpack.optimize.UglifyJsPlugin({ 30 | compress: { 31 | warnings: false 32 | }, 33 | sourceMap: true 34 | }), 35 | // extract css into its own file 36 | new ExtractTextPlugin({ 37 | filename: utils.assetsPath('css/[name].[contenthash].css') 38 | }), 39 | // generate dist index.html with correct asset hash for caching. 40 | // you can customize output by editing /index.html 41 | // see https://github.com/ampedandwired/html-webpack-plugin 42 | new HtmlWebpackPlugin({ 43 | filename: config.build.index, 44 | template: 'index.html', 45 | inject: true, 46 | minify: { 47 | removeComments: true, 48 | collapseWhitespace: true, 49 | removeAttributeQuotes: true 50 | // more options: 51 | // https://github.com/kangax/html-minifier#options-quick-reference 52 | }, 53 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 54 | chunksSortMode: 'dependency' 55 | }), 56 | // split vendor js into its own file 57 | new webpack.optimize.CommonsChunkPlugin({ 58 | name: 'vendor', 59 | minChunks: function (module, count) { 60 | // any required modules inside node_modules are extracted to vendor 61 | return ( 62 | module.resource && 63 | /\.js$/.test(module.resource) && 64 | module.resource.indexOf( 65 | path.join(__dirname, '../node_modules') 66 | ) === 0 67 | ) 68 | } 69 | }), 70 | // extract webpack runtime and module manifest to its own file in order to 71 | // prevent vendor hash from being updated whenever app bundle is updated 72 | new webpack.optimize.CommonsChunkPlugin({ 73 | name: 'manifest', 74 | chunks: ['vendor'] 75 | }) 76 | ] 77 | }) 78 | 79 | if (config.build.productionGzip) { 80 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 81 | 82 | webpackConfig.plugins.push( 83 | new CompressionWebpackPlugin({ 84 | asset: '[path].gz[query]', 85 | algorithm: 'gzip', 86 | test: new RegExp( 87 | '\\.(' + 88 | config.build.productionGzipExtensions.join('|') + 89 | ')$' 90 | ), 91 | threshold: 10240, 92 | minRatio: 0.8 93 | }) 94 | ) 95 | } 96 | 97 | if (config.build.bundleAnalyzerReport) { 98 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 99 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 100 | } 101 | 102 | module.exports = webpackConfig 103 | -------------------------------------------------------------------------------- /monitor-js/monitor/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /monitor-js/monitor/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path'); 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: false, 12 | productionGzip: false, 13 | productionGzipExtensions: ['js', 'css'], 14 | bundleAnalyzerReport: process.env.npm_config_report 15 | }, 16 | dev: { 17 | env: require('./dev.env'), 18 | host:'localhost', 19 | port: 9999, 20 | autoOpenBrowser: true, 21 | assetsSubDirectory: 'static', 22 | assetsPublicPath: '/', 23 | proxyTable: { 24 | '/api':{ 25 | target:'http://127.0.0.1:8000/', 26 | changeOrigin:true, 27 | }, 28 | '/swagger':{ 29 | target:'http://127.0.0.1:8000/', 30 | changeOrigin:true, 31 | } 32 | }, 33 | cssSourceMap: false 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /monitor-js/monitor/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /monitor-js/monitor/dist/index.html: -------------------------------------------------------------------------------- 1 | 辰安监控
-------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/color-dark.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #242f42; 3 | } 4 | .login-wrap{ 5 | background-image: url("../img/sky.jpg"); 6 | } 7 | .plugins-tips{ 8 | background: #eef1f6; 9 | } 10 | .plugins-tips a{ 11 | color: #20a0ff; 12 | } 13 | .el-upload--text em { 14 | color: #20a0ff; 15 | } 16 | .pure-button{ 17 | background: #20a0ff; 18 | } 19 | -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/datasource.css: -------------------------------------------------------------------------------- 1 | .vue-datasource *{ 2 | box-sizing: border-box; 3 | font-size: 14px; 4 | } 5 | .vue-datasource .panel { 6 | margin-bottom: 22px; 7 | background-color: #fff; 8 | border: 1px solid transparent; 9 | border-radius: 4px; 10 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); 11 | } 12 | .vue-datasource .panel-default { 13 | border-color: #d3e0e9; 14 | } 15 | .vue-datasource .panel-heading { 16 | padding: 10px 15px; 17 | border-bottom: 1px solid transparent; 18 | border-top-right-radius: 3px; 19 | border-top-left-radius: 3px; 20 | } 21 | .vue-datasource .panel-default > .panel-heading { 22 | height:56px; 23 | color: #333333; 24 | background-color: #fff; 25 | border-color: #d3e0e9; 26 | } 27 | .vue-datasource .pull-left { 28 | float: left !important; 29 | } 30 | .vue-datasource .pull-right { 31 | float: right !important; 32 | } 33 | .vue-datasource .form-group { 34 | margin-bottom: 15px; 35 | } 36 | .vue-datasource label { 37 | display: inline-block; 38 | max-width: 100%; 39 | margin-bottom: 5px; 40 | font-weight: bold; 41 | } 42 | .vue-datasource .form-control { 43 | display: block; 44 | width: 100%; 45 | height: 36px; 46 | padding: 6px 12px; 47 | font-size: 14px; 48 | line-height: 1.6; 49 | color: #555555; 50 | background-color: #fff; 51 | background-image: none; 52 | border: 1px solid #ccd0d2; 53 | border-radius: 4px; 54 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 55 | -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 56 | transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 57 | } 58 | .vue-datasource .btn { 59 | display: inline-block; 60 | margin-bottom: 0; 61 | font-weight: normal; 62 | text-align: center; 63 | vertical-align: middle; 64 | touch-action: manipulation; 65 | cursor: pointer; 66 | background-image: none; 67 | border: 1px solid transparent; 68 | white-space: nowrap; 69 | padding: 6px 12px; 70 | font-size: 14px; 71 | line-height: 1.6; 72 | border-radius: 4px; 73 | -webkit-user-select: none; 74 | -moz-user-select: none; 75 | -ms-user-select: none; 76 | user-select: none; 77 | } 78 | .vue-datasource .btn-primary { 79 | color: #fff; 80 | background-color: #3097D1; 81 | border-color: #2a88bd; 82 | } 83 | .vue-datasource .table { 84 | width: 100%; 85 | max-width: 100%; 86 | margin-bottom: 22px; 87 | border-collapse: collapse; 88 | border-spacing: 0; 89 | text-align: center; 90 | } 91 | .vue-datasource .table > thead > tr > th { 92 | vertical-align: bottom; 93 | border-bottom: 2px solid #ddd; 94 | } 95 | .vue-datasource .table th ,.vue-datasource .table td { 96 | padding: 8px; 97 | line-height: 1.6; 98 | vertical-align: top; 99 | border-top: 1px solid #ddd; 100 | } 101 | .vue-datasource .table-striped > tbody > tr:nth-of-type(odd) { 102 | background-color: #f9f9f9; 103 | } 104 | .vue-datasource .success th ,.vue-datasource .success td{ 105 | background-color: #dff0d8; 106 | } 107 | .vue-datasource .pagination { 108 | display: inline-block; 109 | padding-left: 0; 110 | margin: 22px 0; 111 | border-radius: 4px; 112 | } 113 | .vue-datasource .pagination > li { 114 | display: inline; 115 | } 116 | .pagination > li > a,.pagination > li > span { 117 | position: relative; 118 | float: left; 119 | padding: 6px 12px; 120 | line-height: 1.6; 121 | text-decoration: none; 122 | color: #3097D1; 123 | background-color: #fff; 124 | border: 1px solid #ddd; 125 | margin-left: -1px; 126 | } 127 | .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { 128 | color: #777777; 129 | background-color: #fff; 130 | border-color: #ddd; 131 | cursor: not-allowed; 132 | } 133 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 134 | z-index: 3; 135 | color: #fff; 136 | background-color: #3097D1; 137 | border-color: #3097D1; 138 | cursor: default; 139 | } 140 | .vue-datasource .pagination > li:first-child > a, .vue-datasource .pagination > li:first-child > span { 141 | margin-left: 0; 142 | border-bottom-left-radius: 4px; 143 | border-top-left-radius: 4px; 144 | } 145 | .vue-datasource .text-center { 146 | text-align: center; 147 | } 148 | 149 | 150 | 151 | 152 | @media (min-width: 768px){ 153 | .form-inline .form-group { 154 | display: inline-block; 155 | margin-bottom: 0; 156 | vertical-align: middle; 157 | } 158 | .form-inline .control-label { 159 | margin-bottom: 0; 160 | vertical-align: middle; 161 | } 162 | .form-inline .form-control { 163 | display: inline-block; 164 | width: auto; 165 | vertical-align: middle; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html, body, #app, .wrapper { 7 | width: 100%; 8 | height: 100%; 9 | overflow: hidden; 10 | } 11 | 12 | body { 13 | font-family: "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; 14 | } 15 | 16 | a { 17 | text-decoration: none 18 | } 19 | 20 | .content { 21 | background: none repeat scroll 0 0 #fff; 22 | position: absolute; 23 | left: 250px; 24 | right: 0; 25 | top: 70px; 26 | bottom: 0; 27 | width: auto; 28 | padding: 40px; 29 | box-sizing: border-box; 30 | overflow-y: scroll; 31 | } 32 | 33 | .crumbs { 34 | margin-bottom: 20px; 35 | } 36 | 37 | .pagination { 38 | margin: 20px 0; 39 | text-align: right; 40 | } 41 | 42 | .plugins-tips { 43 | padding: 20px 10px; 44 | margin-bottom: 20px; 45 | } 46 | 47 | .el-button + .el-tooltip { 48 | margin-left: 10px; 49 | } 50 | 51 | .el-table tr:hover { 52 | background: #f6faff; 53 | } 54 | 55 | .mgb20 { 56 | margin-bottom: 20px; 57 | } 58 | 59 | .move-enter-active, .move-leave-active { 60 | transition: opacity .5s; 61 | } 62 | 63 | .move-enter, .move-leave { 64 | opacity: 0; 65 | } 66 | 67 | /*BaseForm*/ 68 | .form-box { 69 | width: 600px; 70 | } 71 | 72 | .form-box .line { 73 | text-align: center; 74 | } 75 | 76 | .el-time-panel__content::after, .el-time-panel__content::before { 77 | margin-top: -7px; 78 | } 79 | 80 | /*Readme*/ 81 | .ms-doc .el-checkbox__input.is-disabled + .el-checkbox__label { 82 | color: #333; 83 | cursor: pointer; 84 | } 85 | 86 | /*Upload*/ 87 | .pure-button { 88 | width: 150px; 89 | height: 40px; 90 | line-height: 40px; 91 | text-align: center; 92 | color: #fff; 93 | border-radius: 3px; 94 | } 95 | 96 | .g-core-image-corp-container .info-aside { 97 | height: 45px; 98 | } 99 | 100 | .el-upload--text { 101 | background-color: #fff; 102 | border: 1px dashed #d9d9d9; 103 | border-radius: 6px; 104 | box-sizing: border-box; 105 | width: 360px; 106 | height: 180px; 107 | text-align: center; 108 | cursor: pointer; 109 | position: relative; 110 | overflow: hidden; 111 | } 112 | 113 | .el-upload--text .el-icon-upload { 114 | font-size: 67px; 115 | color: #97a8be; 116 | margin: 40px 0 16px; 117 | line-height: 50px; 118 | } 119 | 120 | .el-upload--text { 121 | color: #97a8be; 122 | font-size: 14px; 123 | text-align: center; 124 | } 125 | 126 | .el-upload--text em { 127 | font-style: normal; 128 | } 129 | 130 | /*VueEditor*/ 131 | .ql-container { 132 | min-height: 400px; 133 | } 134 | 135 | .ql-snow .ql-tooltip { 136 | transform: translateX(117.5px) translateY(10px) !important; 137 | } 138 | 139 | .editor-btn { 140 | margin-top: 20px; 141 | } 142 | 143 | 144 | .ivu-timeline-item-tail { 145 | height: 100%; 146 | border-left: 1px dotted purple !important; 147 | position: absolute; 148 | left: 6px; 149 | top: 0; 150 | } 151 | -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/theme-green/color-green.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #00d1b2; 3 | } 4 | .login-wrap{ 5 | background: rgba(56, 157, 170, 0.82);; 6 | } 7 | .plugins-tips{ 8 | background: #f2f2f2; 9 | } 10 | .plugins-tips a{ 11 | color: #00d1b2; 12 | } 13 | .el-upload--text em { 14 | color: #00d1b2; 15 | } 16 | .pure-button{ 17 | background: #00d1b2; 18 | } 19 | .vue-datasource .btn-primary { 20 | color: #fff; 21 | background-color: #00d1b2 !important; 22 | border-color: #00d1b2 !important; 23 | } 24 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 25 | background-color: #00d1b2 !important; 26 | border-color: #00d1b2 !important; 27 | } -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/theme-green/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/css/theme-green/fonts/element-icons.ttf -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/css/theme-green/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/css/theme-green/fonts/element-icons.woff -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/fonts/element-icons.b02bdc1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/fonts/element-icons.b02bdc1.ttf -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/fonts/ionicons.05acfdb.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/fonts/ionicons.05acfdb.woff -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/fonts/ionicons.24712f6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/fonts/ionicons.24712f6.ttf -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/fonts/ionicons.2c2ae06.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/fonts/ionicons.2c2ae06.eot -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/img.2aab7b4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/img.2aab7b4.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/img.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/mongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/mongo.png -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/mysql.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/mysql.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/mysql.png -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/oracle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/oracle.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/oracle2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/oracle2.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/redis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/redis.png -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/sky.871d198.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/sky.871d198.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/sky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/sky.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/img/tomcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/dist/static/img/tomcat.png -------------------------------------------------------------------------------- /monitor-js/monitor/dist/static/js/0.4836f94b3c25f7f992e3.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{1905:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{tableData:[],cur_page:1,multipleSelection:[],select_cate:"",select_word:"",del_list:[],is_search:!1}},created:function(){this.getData()},methods:{handleCurrentChange:function(t){this.cur_page=t,this.getData()},getData:function(){var t=this;t.$http.get("/api/groups/").then(function(e){t.tableData=e.data})},search:function(){this.is_search=!0},formatter:function(t,e){return t.address},filterTag:function(t,e){return e.tag===t},hostDetail:function(t,e){},handleDelete:function(t,e){this.$message.error("删除第"+(t+1)+"行")},delAll:function(){var t=this,e=t.multipleSelection.length,i="";t.del_list=t.del_list.concat(t.multipleSelection);for(var a=0;a 2 | 3 | 4 | 5 | 辰安监控 6 | 7 | 8 | 9 |
10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /monitor-js/monitor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monitor-system", 3 | "version": "2.1.0", 4 | "description": "辰安监控系统", 5 | "author": "huangll", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "build:dll": "webpack --config build/webpack.dll.conf.js" 11 | }, 12 | "dependencies": { 13 | "axios": "^0.15.3", 14 | "babel-polyfill": "^6.23.0", 15 | "china": "0.0.1", 16 | "echarts": "^3.7.2", 17 | "element-ui": "1.3.1", 18 | "iview": "^2.6.0", 19 | "moment": "^2.19.1", 20 | "vue": "^2.3.2", 21 | "vue-awesome": "^2.3.3", 22 | "vue-core-image-upload": "2.1.11", 23 | "vue-datasource": "1.0.9", 24 | "vue-echarts": "^2.4.1", 25 | "vue-flashcard": "^1.1.6", 26 | "vue-ip-input": "^2.0.0", 27 | "vue-particles": "^1.0.9", 28 | "vue-quick-menu": "^1.0.6", 29 | "vue-quill-editor": "2.1.6", 30 | "vue-router": "^2.3.1", 31 | "vue-schart": "^0.1.2", 32 | "vue-simplemde": "0.3.8", 33 | "vue-waterfall": "^1.0.6" 34 | }, 35 | "devDependencies": { 36 | "autoprefixer": "^6.7.2", 37 | "babel-core": "^6.22.1", 38 | "babel-loader": "^6.2.10", 39 | "babel-plugin-transform-runtime": "^6.22.0", 40 | "babel-preset-env": "^1.6.1", 41 | "babel-preset-es2015": "^6.22.0", 42 | "babel-preset-stage-2": "^6.22.0", 43 | "babel-register": "^6.22.0", 44 | "chalk": "^1.1.3", 45 | "connect-history-api-fallback": "^1.3.0", 46 | "css-loader": "^0.28.0", 47 | "eventsource-polyfill": "^0.9.6", 48 | "express": "^4.14.1", 49 | "extract-text-webpack-plugin": "^2.0.0", 50 | "file-loader": "^0.11.1", 51 | "friendly-errors-webpack-plugin": "^1.1.3", 52 | "function-bind": "^1.1.0", 53 | "html-webpack-plugin": "^2.28.0", 54 | "http-proxy-middleware": "^0.17.3", 55 | "opn": "^4.0.2", 56 | "ora": "^1.2.0", 57 | "semver": "^5.3.0", 58 | "shelljs": "^0.7.6", 59 | "url-loader": "^0.5.8", 60 | "vue-loader": "^11.3.4", 61 | "vue-style-loader": "^2.0.5", 62 | "vue-template-compiler": "^2.2.6", 63 | "webpack": "^2.3.3", 64 | "webpack-bundle-analyzer": "^2.2.1", 65 | "webpack-dev-middleware": "^1.10.0", 66 | "webpack-hot-middleware": "^2.18.0", 67 | "webpack-merge": "^4.1.0" 68 | }, 69 | "engines": { 70 | "node": ">= 4.0.0", 71 | "npm": ">= 3.0.0" 72 | }, 73 | "browserslist": [ 74 | "> 1%", 75 | "last 2 versions", 76 | "not ie <= 8" 77 | ], 78 | "babel": { 79 | "presets": [ 80 | "es2015", 81 | "react" 82 | ] 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /monitor-js/monitor/screenshots/wms1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/screenshots/wms1.png -------------------------------------------------------------------------------- /monitor-js/monitor/screenshots/wms2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/screenshots/wms2.png -------------------------------------------------------------------------------- /monitor-js/monitor/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 10 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/src/assets/logo.png -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/ChinaMap.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 131 | 137 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Cpu.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 87 | 93 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Disk.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 93 | 99 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/EventTable.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 87 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Header.vue: -------------------------------------------------------------------------------- 1 | 17 | 40 | 81 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Home.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 20 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Memory.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 82 | 88 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/ServiceChart.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 80 | 85 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/common/Sidebar.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 102 | 103 | 132 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/Agent.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 80 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/ApacheMonitor.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 45 | 46 | 49 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 111 | 112 | 127 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/Events.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 85 | 97 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/FTPMonitor.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 45 | 46 | 49 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/Host.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 122 | 123 | 137 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/HostDetail.vue: -------------------------------------------------------------------------------- 1 | 71 | 72 | 118 | 119 | 157 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/HostGroup.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 84 | 85 | 97 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/HostGroupCircle.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 87 | 88 | 93 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/Login.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 61 | 62 | 101 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/components/page/WaterFall.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 103 | 104 | 110 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import App from './App'; 3 | import router from './router'; 4 | import axios from 'axios'; 5 | import ElementUI from 'element-ui'; 6 | import 'element-ui/lib/theme-default/index.css'; // 默认主题 7 | // import '../static/css/theme-green/index.css'; // 浅绿色主题 8 | import "babel-polyfill"; 9 | import iView from 'iview'; 10 | import 'iview/dist/styles/iview.css'; 11 | 12 | Vue.use(ElementUI); 13 | Vue.prototype.$http = axios; 14 | Vue.use(iView); 15 | 16 | import VueParticles from 'vue-particles' 17 | Vue.use(VueParticles); 18 | 19 | import 'vue-awesome/icons' 20 | 21 | import Icon from 'vue-awesome/components/Icon.vue' 22 | Vue.component('icon',Icon); 23 | 24 | import Echarts from 'vue-echarts/components/ECharts.vue' 25 | Vue.component('chart',Echarts); 26 | 27 | new Vue({ 28 | router, 29 | render: h => h(App) 30 | }).$mount('#app'); 31 | -------------------------------------------------------------------------------- /monitor-js/monitor/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | 4 | Vue.use(Router); 5 | 6 | export default new Router({ 7 | routes: [ 8 | { 9 | path: '/', 10 | redirect: '/login' 11 | }, 12 | { 13 | path: '/dashboard', 14 | component: resolve => require(['../components/common/Home.vue'], resolve), 15 | children: [ 16 | { 17 | path: '/', 18 | component: resolve => require(['../components/page/Dashboard.vue'], resolve) 19 | }, 20 | { 21 | path: '/groups', 22 | component: resolve => require(['../components/page/HostGroupCircle.vue'], resolve) 23 | }, 24 | { 25 | path: '/circle', 26 | component: resolve => require(['../components/page/HostGroupCircle.vue'], resolve) 27 | }, 28 | { 29 | path: '/hosts', 30 | component: resolve => require(['../components/page/Host.vue'], resolve) 31 | }, 32 | { 33 | path: '/hostDetail', 34 | component: resolve => require(['../components/page/HostDetail.vue'], resolve) 35 | }, 36 | { 37 | path: '/events', 38 | component: resolve => require(['../components/page/Events.vue'], resolve) 39 | }, 40 | { 41 | path: '/waterfall', 42 | component: resolve => require(['../components/page/WaterFall.vue'], resolve) 43 | }, 44 | { 45 | path: '/apache', 46 | component: resolve => require(['../components/page/ApacheMonitor.vue'], resolve) 47 | }, 48 | { 49 | path: '/ftp', 50 | component: resolve => require(['../components/page/FTPMonitor.vue'], resolve) 51 | }, 52 | { 53 | path: '/agent', 54 | component: resolve => require(['../components/page/Agent.vue'], resolve) 55 | } 56 | ] 57 | }, 58 | { 59 | path: '/login', 60 | component: resolve => require(['../components/page/Login.vue'], resolve) 61 | }, 62 | ] 63 | }) 64 | -------------------------------------------------------------------------------- /monitor-js/monitor/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/.gitkeep -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/color-dark.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #242f42; 3 | } 4 | .login-wrap{ 5 | background-image: url("../img/sky.jpg"); 6 | } 7 | .plugins-tips{ 8 | background: #eef1f6; 9 | } 10 | .plugins-tips a{ 11 | color: #20a0ff; 12 | } 13 | .el-upload--text em { 14 | color: #20a0ff; 15 | } 16 | .pure-button{ 17 | background: #20a0ff; 18 | } 19 | -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/datasource.css: -------------------------------------------------------------------------------- 1 | .vue-datasource *{ 2 | box-sizing: border-box; 3 | font-size: 14px; 4 | } 5 | .vue-datasource .panel { 6 | margin-bottom: 22px; 7 | background-color: #fff; 8 | border: 1px solid transparent; 9 | border-radius: 4px; 10 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); 11 | } 12 | .vue-datasource .panel-default { 13 | border-color: #d3e0e9; 14 | } 15 | .vue-datasource .panel-heading { 16 | padding: 10px 15px; 17 | border-bottom: 1px solid transparent; 18 | border-top-right-radius: 3px; 19 | border-top-left-radius: 3px; 20 | } 21 | .vue-datasource .panel-default > .panel-heading { 22 | height:56px; 23 | color: #333333; 24 | background-color: #fff; 25 | border-color: #d3e0e9; 26 | } 27 | .vue-datasource .pull-left { 28 | float: left !important; 29 | } 30 | .vue-datasource .pull-right { 31 | float: right !important; 32 | } 33 | .vue-datasource .form-group { 34 | margin-bottom: 15px; 35 | } 36 | .vue-datasource label { 37 | display: inline-block; 38 | max-width: 100%; 39 | margin-bottom: 5px; 40 | font-weight: bold; 41 | } 42 | .vue-datasource .form-control { 43 | display: block; 44 | width: 100%; 45 | height: 36px; 46 | padding: 6px 12px; 47 | font-size: 14px; 48 | line-height: 1.6; 49 | color: #555555; 50 | background-color: #fff; 51 | background-image: none; 52 | border: 1px solid #ccd0d2; 53 | border-radius: 4px; 54 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 55 | -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 56 | transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 57 | } 58 | .vue-datasource .btn { 59 | display: inline-block; 60 | margin-bottom: 0; 61 | font-weight: normal; 62 | text-align: center; 63 | vertical-align: middle; 64 | touch-action: manipulation; 65 | cursor: pointer; 66 | background-image: none; 67 | border: 1px solid transparent; 68 | white-space: nowrap; 69 | padding: 6px 12px; 70 | font-size: 14px; 71 | line-height: 1.6; 72 | border-radius: 4px; 73 | -webkit-user-select: none; 74 | -moz-user-select: none; 75 | -ms-user-select: none; 76 | user-select: none; 77 | } 78 | .vue-datasource .btn-primary { 79 | color: #fff; 80 | background-color: #3097D1; 81 | border-color: #2a88bd; 82 | } 83 | .vue-datasource .table { 84 | width: 100%; 85 | max-width: 100%; 86 | margin-bottom: 22px; 87 | border-collapse: collapse; 88 | border-spacing: 0; 89 | text-align: center; 90 | } 91 | .vue-datasource .table > thead > tr > th { 92 | vertical-align: bottom; 93 | border-bottom: 2px solid #ddd; 94 | } 95 | .vue-datasource .table th ,.vue-datasource .table td { 96 | padding: 8px; 97 | line-height: 1.6; 98 | vertical-align: top; 99 | border-top: 1px solid #ddd; 100 | } 101 | .vue-datasource .table-striped > tbody > tr:nth-of-type(odd) { 102 | background-color: #f9f9f9; 103 | } 104 | .vue-datasource .success th ,.vue-datasource .success td{ 105 | background-color: #dff0d8; 106 | } 107 | .vue-datasource .pagination { 108 | display: inline-block; 109 | padding-left: 0; 110 | margin: 22px 0; 111 | border-radius: 4px; 112 | } 113 | .vue-datasource .pagination > li { 114 | display: inline; 115 | } 116 | .pagination > li > a,.pagination > li > span { 117 | position: relative; 118 | float: left; 119 | padding: 6px 12px; 120 | line-height: 1.6; 121 | text-decoration: none; 122 | color: #3097D1; 123 | background-color: #fff; 124 | border: 1px solid #ddd; 125 | margin-left: -1px; 126 | } 127 | .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { 128 | color: #777777; 129 | background-color: #fff; 130 | border-color: #ddd; 131 | cursor: not-allowed; 132 | } 133 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 134 | z-index: 3; 135 | color: #fff; 136 | background-color: #3097D1; 137 | border-color: #3097D1; 138 | cursor: default; 139 | } 140 | .vue-datasource .pagination > li:first-child > a, .vue-datasource .pagination > li:first-child > span { 141 | margin-left: 0; 142 | border-bottom-left-radius: 4px; 143 | border-top-left-radius: 4px; 144 | } 145 | .vue-datasource .text-center { 146 | text-align: center; 147 | } 148 | 149 | 150 | 151 | 152 | @media (min-width: 768px){ 153 | .form-inline .form-group { 154 | display: inline-block; 155 | margin-bottom: 0; 156 | vertical-align: middle; 157 | } 158 | .form-inline .control-label { 159 | margin-bottom: 0; 160 | vertical-align: middle; 161 | } 162 | .form-inline .form-control { 163 | display: inline-block; 164 | width: auto; 165 | vertical-align: middle; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html, body, #app, .wrapper { 7 | width: 100%; 8 | height: 100%; 9 | overflow: hidden; 10 | } 11 | 12 | body { 13 | font-family: "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; 14 | } 15 | 16 | a { 17 | text-decoration: none 18 | } 19 | 20 | .content { 21 | background: none repeat scroll 0 0 #fff; 22 | position: absolute; 23 | left: 250px; 24 | right: 0; 25 | top: 70px; 26 | bottom: 0; 27 | width: auto; 28 | padding: 40px; 29 | box-sizing: border-box; 30 | overflow-y: scroll; 31 | } 32 | 33 | .crumbs { 34 | margin-bottom: 20px; 35 | } 36 | 37 | .pagination { 38 | margin: 20px 0; 39 | text-align: right; 40 | } 41 | 42 | .plugins-tips { 43 | padding: 20px 10px; 44 | margin-bottom: 20px; 45 | } 46 | 47 | .el-button + .el-tooltip { 48 | margin-left: 10px; 49 | } 50 | 51 | .el-table tr:hover { 52 | background: #f6faff; 53 | } 54 | 55 | .mgb20 { 56 | margin-bottom: 20px; 57 | } 58 | 59 | .move-enter-active, .move-leave-active { 60 | transition: opacity .5s; 61 | } 62 | 63 | .move-enter, .move-leave { 64 | opacity: 0; 65 | } 66 | 67 | /*BaseForm*/ 68 | .form-box { 69 | width: 600px; 70 | } 71 | 72 | .form-box .line { 73 | text-align: center; 74 | } 75 | 76 | .el-time-panel__content::after, .el-time-panel__content::before { 77 | margin-top: -7px; 78 | } 79 | 80 | /*Readme*/ 81 | .ms-doc .el-checkbox__input.is-disabled + .el-checkbox__label { 82 | color: #333; 83 | cursor: pointer; 84 | } 85 | 86 | /*Upload*/ 87 | .pure-button { 88 | width: 150px; 89 | height: 40px; 90 | line-height: 40px; 91 | text-align: center; 92 | color: #fff; 93 | border-radius: 3px; 94 | } 95 | 96 | .g-core-image-corp-container .info-aside { 97 | height: 45px; 98 | } 99 | 100 | .el-upload--text { 101 | background-color: #fff; 102 | border: 1px dashed #d9d9d9; 103 | border-radius: 6px; 104 | box-sizing: border-box; 105 | width: 360px; 106 | height: 180px; 107 | text-align: center; 108 | cursor: pointer; 109 | position: relative; 110 | overflow: hidden; 111 | } 112 | 113 | .el-upload--text .el-icon-upload { 114 | font-size: 67px; 115 | color: #97a8be; 116 | margin: 40px 0 16px; 117 | line-height: 50px; 118 | } 119 | 120 | .el-upload--text { 121 | color: #97a8be; 122 | font-size: 14px; 123 | text-align: center; 124 | } 125 | 126 | .el-upload--text em { 127 | font-style: normal; 128 | } 129 | 130 | /*VueEditor*/ 131 | .ql-container { 132 | min-height: 400px; 133 | } 134 | 135 | .ql-snow .ql-tooltip { 136 | transform: translateX(117.5px) translateY(10px) !important; 137 | } 138 | 139 | .editor-btn { 140 | margin-top: 20px; 141 | } 142 | 143 | 144 | .ivu-timeline-item-tail { 145 | height: 100%; 146 | border-left: 1px dotted purple !important; 147 | position: absolute; 148 | left: 6px; 149 | top: 0; 150 | } 151 | -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/theme-green/color-green.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #00d1b2; 3 | } 4 | .login-wrap{ 5 | background: rgba(56, 157, 170, 0.82);; 6 | } 7 | .plugins-tips{ 8 | background: #f2f2f2; 9 | } 10 | .plugins-tips a{ 11 | color: #00d1b2; 12 | } 13 | .el-upload--text em { 14 | color: #00d1b2; 15 | } 16 | .pure-button{ 17 | background: #00d1b2; 18 | } 19 | .vue-datasource .btn-primary { 20 | color: #fff; 21 | background-color: #00d1b2 !important; 22 | border-color: #00d1b2 !important; 23 | } 24 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 25 | background-color: #00d1b2 !important; 26 | border-color: #00d1b2 !important; 27 | } -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/theme-green/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/css/theme-green/fonts/element-icons.ttf -------------------------------------------------------------------------------- /monitor-js/monitor/static/css/theme-green/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/css/theme-green/fonts/element-icons.woff -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/img.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/mongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/mongo.png -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/mysql.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/mysql.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/mysql.png -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/oracle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/oracle.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/oracle2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/oracle2.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/redis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/redis.png -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/sky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/sky.jpg -------------------------------------------------------------------------------- /monitor-js/monitor/static/img/tomcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-js/monitor/static/img/tomcat.png -------------------------------------------------------------------------------- /monitor-py/monitor/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /monitor-py/monitor/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /monitor-py/monitor/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /monitor-py/monitor/.idea/monitor.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 29 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/__init__.py -------------------------------------------------------------------------------- /monitor-py/monitor/api/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/__init__.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/admin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.contrib import admin 5 | 6 | # Register your models here. 7 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/admin.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/agent_view.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse 2 | import json 3 | #from playbook import play 4 | import yaml 5 | import zabbix 6 | 7 | 8 | def deploy_agent(request): 9 | agent = json.loads(request.body) 10 | hostname = agent['hostname'] 11 | group = agent['group'] 12 | host = agent['host'] 13 | ip = agent['ip'] 14 | template = agent['template'] 15 | password = agent['password'] 16 | 17 | fw = open('./host.yaml', 'w') 18 | new_data = [{'tasks': [{'shell': 'rm -rf /etc/yum.repos.d/*', 'name': 'clean repo'}, 19 | {'copy': 'src=./src/CentOS-Media.repo dest=/etc/yum.repos.d/', 20 | 'name': 'configure mirrors'}, 21 | {'shell': 'yum clean all&yum makecache', 'name': 'update repo'}, 22 | {'yum': 'pkg=zabbix-agent state=latest', 'name': 'install zabbix.agent'}, 23 | {'name': 'stop firewalld', 'service': 'name=firewalld state=stopped'}, 24 | {'copy': 'src=./src/zabbix_agentd.conf dest=/etc/zabbix/', 25 | 'name': 'copy zabbix-agent'}, 26 | {'hostname': 'name=' + hostname}, 27 | {'command': "sed -i 's/vm1/" + hostname + "/g' /etc/zabbix/zabbix_agentd.conf", 28 | 'name': 'configuration zabbix-agent'}, 29 | {'name': 'start zabbix-agent', 'service': 'name=zabbix-agent state=started'}], 30 | 'hosts': 'all', 31 | 'remote_user': 'root'}] 32 | 33 | yaml.dump(new_data, fw) 34 | fw.close() 35 | #play(ip, password, './host.yaml') 36 | zabbix.create_host(group, hostname, ip, template) 37 | return HttpResponse('ok') 38 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/agent_view.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/agent_view.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/apps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.apps import AppConfig 5 | 6 | 7 | class ApiConfig(AppConfig): 8 | name = 'api' 9 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/apps.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/apps.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/migrations/__init__.py -------------------------------------------------------------------------------- /monitor-py/monitor/api/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/migrations/__init__.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.db import models 5 | 6 | # Create your models here. 7 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/models.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/playbook.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # encoding=utf-8 3 | import fileinput 4 | from collections import namedtuple 5 | from ansible.parsing.dataloader import DataLoader 6 | from ansible.vars import VariableManager 7 | from ansible.inventory import Inventory 8 | from ansible.executor.playbook_executor import PlaybookExecutor 9 | 10 | 11 | def play(vm_ip, vm_password, yaml_pathfile): 12 | # load yaml file 13 | loader = DataLoader() 14 | # class studio 15 | variable_manager = VariableManager() 16 | inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=[vm_ip]) 17 | variable_manager.set_inventory(inventory) 18 | passwords = dict(conn_pass=vm_password) 19 | Options = namedtuple('Options', 20 | ['connection', 21 | 'remote_user', 22 | 'ask_sudo_pass', 23 | 'verbosity', 24 | 'ack_pass', 25 | 'module_path', 26 | 'forks', 27 | 'become', 28 | 'become_method', 29 | 'become_user', 30 | 'check', 31 | 'listhosts', 32 | 'listtasks', 33 | 'listtags', 34 | 'syntax', 35 | 'sudo_user', 36 | 'sudo']) 37 | options = Options(connection='smart', 38 | remote_user='root', 39 | ack_pass=None, 40 | sudo_user='root', 41 | forks=5, 42 | sudo='yes', 43 | ask_sudo_pass=False, 44 | verbosity=5, 45 | module_path=None, 46 | become=True, 47 | become_method='sudo', 48 | become_user='root', 49 | check=None, 50 | listhosts=None, 51 | listtasks=None, 52 | listtags=None, 53 | syntax=None) 54 | 55 | playbook = PlaybookExecutor(playbooks=[yaml_pathfile], inventory=inventory, 56 | variable_manager=variable_manager, 57 | loader=loader, options=options, passwords=passwords) 58 | playbook.run() 59 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/src/CentOS-Media.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Media.repo 2 | # 3 | # This repo can be used with mounted DVD media, verify the mount point for 4 | # CentOS-7. You can use this repo and yum to install items directly off the 5 | # DVD ISO that we release. 6 | # 7 | # To use this repo, put in your DVD and use it with the other repos too: 8 | # yum --enablerepo=c7-media [command] 9 | # 10 | # or for ONLY the media repo, do this: 11 | # 12 | # yum --disablerepo=\* --enablerepo=c7-media [command] 13 | 14 | [c7-os] 15 | name=CentOS-7.3-os 16 | baseurl=http://172.17.38.110/centos/os/ 17 | gpgcheck=0 18 | enabled=1 19 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 20 | [c7-extra] 21 | name=CentOS-7.3-extra 22 | baseurl=http://172.17.38.110/centos/ 23 | gpgcheck=0 24 | enabled=1 25 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 26 | 27 | 28 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/src/zabbix_agentd.conf: -------------------------------------------------------------------------------- 1 | # This is a config file for the Zabbix agent daemon (Unix) 2 | # To get more information about Zabbix, visit http://www.zabbix.com 3 | 4 | ############ GENERAL PARAMETERS ################# 5 | 6 | ### Option: PidFile 7 | # Name of PID file. 8 | # 9 | # Mandatory: no 10 | # Default: 11 | # PidFile=/tmp/zabbix_agentd.pid 12 | 13 | PidFile=/var/run/zabbix/zabbix_agentd.pid 14 | 15 | ### Option: LogFile 16 | # Name of log file. 17 | # If not set, syslog is used. 18 | # 19 | # Mandatory: no 20 | # Default: 21 | # LogFile= 22 | 23 | LogFile=/var/log/zabbix/zabbix_agentd.log 24 | 25 | ### Option: LogFileSize 26 | # Maximum size of log file in MB. 27 | # 0 - disable automatic log rotation. 28 | # 29 | # Mandatory: no 30 | # Range: 0-1024 31 | # Default: 32 | # LogFileSize=1 33 | 34 | LogFileSize=0 35 | 36 | ### Option: DebugLevel 37 | # Specifies debug level 38 | # 0 - basic information about starting and stopping of Zabbix processes 39 | # 1 - critical information 40 | # 2 - error information 41 | # 3 - warnings 42 | # 4 - for debugging (produces lots of information) 43 | # 44 | # Mandatory: no 45 | # Range: 0-4 46 | # Default: 47 | # DebugLevel=3 48 | 49 | ### Option: SourceIP 50 | # Source IP address for outgoing connections. 51 | # 52 | # Mandatory: no 53 | # Default: 54 | # SourceIP= 55 | 56 | ### Option: EnableRemoteCommands 57 | # Whether remote commands from Zabbix server are allowed. 58 | # 0 - not allowed 59 | # 1 - allowed 60 | # 61 | # Mandatory: no 62 | # Default: 63 | # EnableRemoteCommands=0 64 | EnableRemoteCommands=1 65 | ### Option: LogRemoteCommands 66 | # Enable logging of executed shell commands as warnings. 67 | # 0 - disabled 68 | # 1 - enabled 69 | # 70 | # Mandatory: no 71 | # Default: 72 | # LogRemoteCommands=0 73 | 74 | ##### Passive checks related 75 | 76 | ### Option: Server 77 | # List of comma delimited IP addresses (or hostnames) of Zabbix servers. 78 | # Incoming connections will be accepted only from the hosts listed here. 79 | # If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally. 80 | # 81 | # Mandatory: no 82 | # Default: 83 | # Server= 84 | 85 | Server=172.17.10.237 86 | 87 | ### Option: ListenPort 88 | # Agent will listen on this port for connections from the server. 89 | # 90 | # Mandatory: no 91 | # Range: 1024-32767 92 | # Default: 93 | # ListenPort=10050 94 | 95 | ### Option: ListenIP 96 | # List of comma delimited IP addresses that the agent should listen on. 97 | # First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks. 98 | # 99 | # Mandatory: no 100 | # Default: 101 | # ListenIP=0.0.0.0 102 | 103 | ### Option: StartAgents 104 | # Number of pre-forked instances of zabbix_agentd that process passive checks. 105 | # If set to 0, disables passive checks and the agent will not listen on any TCP port. 106 | # 107 | # Mandatory: no 108 | # Range: 0-100 109 | # Default: 110 | # StartAgents=3 111 | 112 | ##### Active checks related 113 | 114 | ### Option: ServerActive 115 | # List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks. 116 | # If port is not specified, default port is used. 117 | # IPv6 addresses must be enclosed in square brackets if port for that host is specified. 118 | # If port is not specified, square brackets for IPv6 addresses are optional. 119 | # If this parameter is not specified, active checks are disabled. 120 | # Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1] 121 | # 122 | # Mandatory: no 123 | # Default: 124 | # ServerActive= 125 | 126 | #ServerActive=172.17.10.237 127 | 128 | ### Option: Hostname 129 | # Unique, case sensitive hostname. 130 | # Required for active checks and must match hostname as configured on the server. 131 | # Value is acquired from HostnameItem if undefined. 132 | # 133 | # Mandatory: no 134 | # Default: 135 | # Hostname= 136 | Hostname=vm1 137 | 138 | ### Option: HostnameItem 139 | # Item used for generating Hostname if it is undefined. Ignored if Hostname is defined. 140 | # Does not support UserParameters or aliases. 141 | # 142 | # Mandatory: no 143 | # Default: 144 | # HostnameItem=system.hostname 145 | 146 | ### Option: HostMetadata 147 | # Optional parameter that defines host metadata. 148 | # Host metadata is used at host auto-registration process. 149 | # An agent will issue an error and not start if the value is over limit of 255 characters. 150 | # If not defined, value will be acquired from HostMetadataItem. 151 | # 152 | # Mandatory: no 153 | # Range: 0-255 characters 154 | # Default: 155 | # HostMetadata= 156 | 157 | ### Option: HostMetadataItem 158 | # Optional parameter that defines an item used for getting host metadata. 159 | # Host metadata is used at host auto-registration process. 160 | # During an auto-registration request an agent will log a warning message if 161 | # the value returned by specified item is over limit of 255 characters. 162 | # This option is only used when HostMetadata is not defined. 163 | # 164 | # Mandatory: no 165 | # Default: 166 | # HostMetadataItem= 167 | 168 | ### Option: RefreshActiveChecks 169 | # How often list of active checks is refreshed, in seconds. 170 | # 171 | # Mandatory: no 172 | # Range: 60-3600 173 | # Default: 174 | # RefreshActiveChecks=120 175 | 176 | ### Option: BufferSend 177 | # Do not keep data longer than N seconds in buffer. 178 | # 179 | # Mandatory: no 180 | # Range: 1-3600 181 | # Default: 182 | # BufferSend=5 183 | 184 | ### Option: BufferSize 185 | # Maximum number of values in a memory buffer. The agent will send 186 | # all collected data to Zabbix Server or Proxy if the buffer is full. 187 | # 188 | # Mandatory: no 189 | # Range: 2-65535 190 | # Default: 191 | # BufferSize=100 192 | 193 | ### Option: MaxLinesPerSecond 194 | # Maximum number of new lines the agent will send per second to Zabbix Server 195 | # or Proxy processing 'log' and 'logrt' active checks. 196 | # The provided value will be overridden by the parameter 'maxlines', 197 | # provided in 'log' or 'logrt' item keys. 198 | # 199 | # Mandatory: no 200 | # Range: 1-1000 201 | # Default: 202 | # MaxLinesPerSecond=100 203 | 204 | ############ ADVANCED PARAMETERS ################# 205 | 206 | ### Option: Alias 207 | # Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one. 208 | # Multiple Alias parameters may be present. Multiple parameters with the same Alias key are not allowed. 209 | # Different Alias keys may reference the same item key. 210 | # For example, to retrieve the ID of user 'zabbix': 211 | # Alias=zabbix.userid:vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1] 212 | # Now shorthand key zabbix.userid may be used to retrieve data. 213 | # Aliases can be used in HostMetadataItem but not in HostnameItem parameters. 214 | # 215 | # Mandatory: no 216 | # Range: 217 | # Default: 218 | 219 | ### Option: Timeout 220 | # Spend no more than Timeout seconds on processing 221 | # 222 | # Mandatory: no 223 | # Range: 1-30 224 | # Default: 225 | # Timeout=3 226 | 227 | ### Option: AllowRoot 228 | # Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent 229 | # will try to switch to the user specified by the User configuration option instead. 230 | # Has no effect if started under a regular user. 231 | # 0 - do not allow 232 | # 1 - allow 233 | # 234 | # Mandatory: no 235 | # Default: 236 | # AllowRoot=0 237 | 238 | ### Option: User 239 | # Drop privileges to a specific, existing user on the system. 240 | # Only has effect if run as 'root' and AllowRoot is disabled. 241 | # 242 | # Mandatory: no 243 | # Default: 244 | # User=zabbix 245 | 246 | ### Option: Include 247 | # You may include individual files or all files in a directory in the configuration file. 248 | # Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time. 249 | # 250 | # Mandatory: no 251 | # Default: 252 | # Include= 253 | 254 | Include=/etc/zabbix/zabbix_agentd.d/ 255 | 256 | # Include=/usr/local/etc/zabbix_agentd.userparams.conf 257 | # Include=/usr/local/etc/zabbix_agentd.conf.d/ 258 | # Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf 259 | 260 | ####### USER-DEFINED MONITORED PARAMETERS ####### 261 | 262 | ### Option: UnsafeUserParameters 263 | # Allow all characters to be passed in arguments to user-defined parameters. 264 | # 0 - do not allow 265 | # 1 - allow 266 | # 267 | # Mandatory: no 268 | # Range: 0-1 269 | # Default: 270 | # UnsafeUserParameters=0 271 | 272 | ### Option: UserParameter 273 | # User-defined parameter to monitor. There can be several user-defined parameters. 274 | # Format: UserParameter=, 275 | # See 'zabbix_agentd' directory for examples. 276 | # 277 | # Mandatory: no 278 | # Default: 279 | # UserParameter= 280 | 281 | ####### LOADABLE MODULES ####### 282 | 283 | ### Option: LoadModulePath 284 | # Full path to location of agent modules. 285 | # Default depends on compilation options. 286 | # 287 | # Mandatory: no 288 | # Default: 289 | # LoadModulePath=${libdir}/modules 290 | 291 | ### Option: LoadModule 292 | # Module to load at agent startup. Modules are used to extend functionality of the agent. 293 | # Format: LoadModule= 294 | # The modules must be located in directory specified by LoadModulePath. 295 | # It is allowed to include multiple LoadModule parameters. 296 | # 297 | # Mandatory: no 298 | # Default: 299 | # LoadModule= 300 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/tests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.test import TestCase 5 | 6 | # Create your tests here. 7 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, include 2 | from rest_framework import routers 3 | import views 4 | import agent_view 5 | 6 | router = routers.DefaultRouter() 7 | router.register(r'groups', views.GroupView, 'groups') 8 | router.register(r'hosts', views.HostView, 'hosts') 9 | router.register(r'cpu', views.CpuView, 'cpu') 10 | router.register(r'memory', views.MemoryView, 'memory') 11 | router.register(r'disk', views.DiskView, 'disk') 12 | router.register(r'event', views.EventView, 'event') 13 | router.register(r'usage', views.UsageView, 'usage') 14 | router.register(r'totalUsage', views.TotalUsageView, 'totalUsage') 15 | router.register(r'serviceItems', views.ServiceItemsView, 'service') 16 | router.register(r'history', views.HistoryView, 'history') 17 | router.register(r'template', views.TemplateView, 'template') 18 | 19 | urlpatterns = [ 20 | url(r'^', include(router.urls)), 21 | url(r'^auth/', include('rest_framework.urls')), 22 | url(r'^deploy/', agent_view.deploy_agent, name='deploy'), 23 | ] 24 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/urls.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | # Create your views here. 5 | from rest_framework import mixins 6 | from rest_framework.response import Response 7 | from rest_framework.viewsets import ViewSet 8 | 9 | import zabbix 10 | 11 | 12 | class HostView(mixins.ListModelMixin, ViewSet): 13 | """ 14 | 主机列表,根据组来查询 15 | """ 16 | 17 | def list(self, request, *args, **kwargs): 18 | group = request.query_params.get('group', None) 19 | if group: 20 | return Response(zabbix.host_list(group)) 21 | else: 22 | return Response(zabbix.host_list()) 23 | 24 | 25 | class GroupView(mixins.ListModelMixin, ViewSet): 26 | """ 27 | 主机组列表 28 | """ 29 | 30 | def list(self, request, *args, **kwargs): 31 | return Response(zabbix.group_list()) 32 | 33 | 34 | class TemplateView(mixins.ListModelMixin, ViewSet): 35 | """ 36 | 模板列表 37 | """ 38 | 39 | def list(self, request, *args, **kwargs): 40 | return Response(zabbix.template_list()) 41 | 42 | 43 | class CpuView(mixins.ListModelMixin, ViewSet): 44 | """ 45 | 获取主机cpu监控数据 46 | """ 47 | 48 | def list(self, request, *args, **kwargs): 49 | hostid = request.query_params.get('hostid', None) 50 | return Response(zabbix.cpu_list(hostid)) 51 | 52 | 53 | class MemoryView(mixins.ListModelMixin, ViewSet): 54 | """ 55 | 获取主机memory监控数据 56 | """ 57 | 58 | def list(self, request, *args, **kwargs): 59 | hostid = request.query_params.get('hostid', None) 60 | return Response(zabbix.memory_list(hostid)) 61 | 62 | 63 | class DiskView(mixins.ListModelMixin, ViewSet): 64 | """ 65 | 获取主机disk监控数据 66 | """ 67 | 68 | def list(self, request, *args, **kwargs): 69 | hostid = request.query_params.get('hostid', None) 70 | return Response(zabbix.disk_list(hostid)) 71 | 72 | 73 | class UsageView(mixins.ListModelMixin, ViewSet): 74 | """ 75 | 获取CPU,内存,磁盘使用占比, 76 | 参数:hostid 77 | """ 78 | 79 | def list(self, request, *args, **kwargs): 80 | hostid = request.query_params.get('hostid', None) 81 | if hostid: 82 | return Response(zabbix.usage(hostid)) 83 | else: 84 | return Response() 85 | 86 | 87 | class EventView(mixins.ListModelMixin, ViewSet): 88 | """ 89 | 获取事件列表 90 | """ 91 | 92 | def list(self, request, *args, **kwargs): 93 | return Response(zabbix.event_list()) 94 | 95 | 96 | class ServiceItemsView(mixins.ListModelMixin, ViewSet): 97 | """ 98 | 获取服务类型(如 Httpd/FTP)获取监控历史数据 99 | """ 100 | 101 | def list(self, request, *args, **kwargs): 102 | service = request.query_params.get('service', None) 103 | history_list = zabbix.service_item_list(service) 104 | return Response(history_list) 105 | 106 | 107 | class HistoryView(mixins.ListModelMixin, ViewSet): 108 | """ 109 | 根据 itemid 获取历史数据 110 | """ 111 | 112 | def list(self, request, *args, **kwargs): 113 | itemid = request.query_params.get('itemid', None) 114 | history_list = zabbix.history_list(itemid) 115 | return Response(history_list) 116 | 117 | 118 | class TotalUsageView(mixins.ListModelMixin, ViewSet): 119 | """ 120 | 获取CPU,内存,磁盘使用占比, 121 | """ 122 | 123 | def list(self, request, *args, **kwargs): 124 | return Response([zabbix.all_usage()]) 125 | 126 | 127 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/views.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/api/zabbix-demo.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import time 3 | from pyzabbix import ZabbixAPI 4 | import json 5 | 6 | # 登录zabbix 7 | zabbix = ZabbixAPI('http://172.17.38.107/zabbix') 8 | zabbix.session.verify = False 9 | zabbix.login('Admin', 'zabbix') 10 | 11 | hostid = '10110' 12 | 13 | # 根据主机查询监控项 14 | res = zabbix.item.get( 15 | hostids=[hostid], 16 | output=["name", 17 | "key_", 18 | "value_type", 19 | "hostid", 20 | "status", 21 | "state"], 22 | # filter={'key_': 'system.cpu.load[percpu,avg1]'} 23 | ) 24 | 25 | dump = json.dumps(res) 26 | print dump 27 | 28 | itemid = res[0]['itemid'] 29 | 30 | print itemid 31 | 32 | t_till = int(time.time()) 33 | t_from = t_till - 2 * 24 * 60 * 60 34 | print t_from 35 | print t_till 36 | 37 | # 查询cpu历史数据 38 | history = zabbix.history.get( 39 | # hostids=[hostid], 40 | itemids=[itemid], 41 | history=0, 42 | output='extend', 43 | sortfield='clock', 44 | sortorder='ASC', 45 | time_from=t_from, 46 | time_till=t_till 47 | ) 48 | 49 | json_dump = json.dumps(history) 50 | print json_dump 51 | 52 | values = '' 53 | for item in history: 54 | values = values + item['value'] + ',' 55 | 56 | times = '' 57 | for item in history: 58 | times = times + item['clock'] + ',' 59 | # times.append(item['clock']) 60 | 61 | hosts = zabbix.host.get(output='extend') 62 | 63 | triggers = zabbix.trigger.get( 64 | output=['triggerid', 'description', 'priority'] 65 | ) 66 | 67 | print json.dumps(triggers) 68 | 69 | triggerDict = {} 70 | for trigger in triggers: 71 | triggerDict[trigger['triggerid']] = trigger 72 | 73 | events = zabbix.event.get( 74 | output='extend', 75 | selectHosts=['hostid', 'host'], 76 | sortfield='clock', 77 | sortorder='DESC', 78 | time_from=t_from, 79 | time_till=t_till 80 | ) 81 | 82 | res = [{ 83 | 'clock': event['clock'], 84 | 'eventid': event['eventid'], 85 | 'acknowledged': event['acknowledged'], 86 | 'hosts': event['hosts'], 87 | 'trigger': triggerDict.get(event['objectid']) 88 | } for event in events] 89 | 90 | itemids = zabbix.item.get( 91 | hostids=[hostid], 92 | output=["name", 93 | "key_", 94 | "value_type", 95 | "hostid", 96 | "status", 97 | "state"], 98 | filter={'key_': 'vfs.fs.size[/,pfree]'} 99 | ) 100 | 101 | print itemids[0]['itemid'] 102 | 103 | history = zabbix.history.get( 104 | # hostids=[hostid], 105 | itemids=[itemids[0]['itemid']], 106 | history=0, 107 | output='extend', 108 | sortfield='clock', 109 | sortorder='ASC', 110 | limit=1 111 | ) 112 | 113 | print json.dumps(history) 114 | 115 | # 所有监控项 116 | items = zabbix.item.get( 117 | output=['itemid', 'description'], 118 | filter={'name': 'httpd'}, 119 | selectHosts=['name', 'host'], 120 | ) 121 | print json.dumps(items) 122 | 123 | for item in items: 124 | history = zabbix.history.get( 125 | itemids=[item['itemid']], 126 | history=3, 127 | output='extend', 128 | sortfield='clock', 129 | sortorder='ASC', 130 | time_from=t_from, 131 | time_till=t_till, 132 | 133 | ) 134 | print json.dumps(history) 135 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/zabbix-usage-demo.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from pyzabbix import ZabbixAPI 3 | import json 4 | 5 | # 登录zabbix 6 | zabbix = ZabbixAPI('http://172.17.38.107/zabbix') 7 | zabbix.session.verify = False 8 | zabbix.login('Admin', 'zabbix') 9 | 10 | hostid = '10110' 11 | 12 | # 根据主机查询监控项 13 | res = zabbix.item.get( 14 | hostids=[hostid], 15 | output=["name", 16 | "key_", 17 | "value_type", 18 | "hostid", 19 | "status", 20 | "state"], 21 | # filter={'key_': 'system.cpu.load[percpu,avg1]'} 22 | ) 23 | 24 | dump = json.dumps(res) 25 | print dump 26 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/zabbix.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import time 3 | from pyzabbix import ZabbixAPI 4 | 5 | # 登录zabbix 6 | zabbix = ZabbixAPI('http://172.17.38.107/zabbix') 7 | zabbix.session.verify = False 8 | zabbix.login('Admin', 'zabbix') 9 | 10 | 11 | def group_list(): 12 | return zabbix.hostgroup.get( 13 | output=['groupid', 'name'] 14 | ) 15 | 16 | 17 | def template_list(): 18 | return zabbix.template.get(output=['name']) 19 | 20 | 21 | def host_list(group=None): 22 | if group: 23 | return zabbix.host.get( 24 | output=['host', 'hostid', 'name', 'available'], 25 | groupids=[group], 26 | selectGroups=['name'] 27 | ) 28 | else: 29 | return zabbix.host.get( 30 | output=['host', 'hostid', 'name', 'available'], 31 | selectGroups=['name'] 32 | ) 33 | 34 | 35 | def cpu_list(hostid): 36 | if hostid: 37 | item = zabbix.item.get(hostids=[hostid], output=["name", "key_", "value_type", "hostid", "status", "state"], 38 | filter={'key_': 'system.cpu.load[percpu,avg1]'}) 39 | 40 | itemid = item[0]['itemid'] 41 | t_till = int(time.time()) 42 | t_from = t_till - 2 * 24 * 60 * 60 43 | 44 | return zabbix.history.get( 45 | # hostids=[hostid], 46 | itemids=[itemid], 47 | history=0, 48 | output='extend', 49 | sortfield='clock', 50 | sortorder='ASC', 51 | time_from=t_from, 52 | time_till=t_till 53 | ) 54 | 55 | 56 | def memory_list(hostid): 57 | if hostid: 58 | item = zabbix.item.get(hostids=[hostid], output=["name", "key_", "value_type", "hostid", "status", "state"], 59 | filter={'key_': 'vm.memory.size[available]'}) 60 | 61 | itemid = item[0]['itemid'] 62 | t_till = int(time.time()) 63 | t_from = t_till - 2 * 24 * 60 * 60 64 | 65 | return zabbix.history.get( 66 | # hostids=[hostid], 67 | itemids=[itemid], 68 | history=3, 69 | output='extend', 70 | sortfield='clock', 71 | sortorder='ASC', 72 | time_from=t_from, 73 | time_till=t_till 74 | ) 75 | 76 | 77 | def disk_list(hostid): 78 | if hostid: 79 | item = zabbix.item.get(hostids=[hostid], output=["name", "key_", "value_type", "hostid", "status", "state"], 80 | filter={'key_': 'vfs.fs.size[/,free]'}) 81 | 82 | itemid = item[0]['itemid'] 83 | t_till = int(time.time()) 84 | t_from = t_till - 2 * 24 * 60 * 60 85 | 86 | return zabbix.history.get( 87 | # hostids=[hostid], 88 | itemids=[itemid], 89 | history=3, 90 | output='extend', 91 | sortfield='clock', 92 | sortorder='ASC', 93 | time_from=t_from, 94 | time_till=t_till 95 | ) 96 | 97 | 98 | def event_list(): 99 | t_till = int(time.time()) 100 | t_from = t_till - 7 * 24 * 60 * 60 101 | 102 | triggers = zabbix.trigger.get( 103 | output=['triggerid', 'description', 'priority'] 104 | ) 105 | triggerDict = {} 106 | for trigger in triggers: 107 | triggerDict[trigger['triggerid']] = trigger 108 | 109 | events = zabbix.event.get( 110 | output='extend', 111 | selectHosts=['name', 'host'], 112 | sortfield='clock', 113 | sortorder='DESC', 114 | time_from=t_from, 115 | time_till=t_till, 116 | limit=100 117 | ) 118 | return [{ 119 | 'clock': event['clock'], 120 | 'eventid': event['eventid'], 121 | 'acknowledged': event['acknowledged'], 122 | 'hosts': event['hosts'], 123 | 'trigger': triggerDict.get(event['objectid']) 124 | } for event in events] 125 | 126 | 127 | def usage(hostid): 128 | diskItemids = zabbix.item.get( 129 | hostids=[hostid], 130 | output=["name", 131 | "key_", 132 | "value_type", 133 | "hostid", 134 | "status", 135 | "state"], 136 | filter={'key_': 'vfs.fs.size[/,pfree]'} 137 | ) 138 | diskUsage = zabbix.history.get(itemids=[diskItemids[0]['itemid']], history=0, output='extend', sortfield='clock', 139 | sortorder='ASC', limit=1) 140 | cpuItemids = zabbix.item.get( 141 | hostids=[hostid], 142 | output=["name", 143 | "key_", 144 | "value_type", 145 | "hostid", 146 | "status", 147 | "state"], 148 | filter={'key_': 'system.cpu.load[percpu,avg1]'} 149 | ) 150 | cpuUsage = zabbix.history.get(itemids=[cpuItemids[0]['itemid']], history=0, output='extend', sortfield='clock', 151 | sortorder='ASC', limit=1) 152 | 153 | memoryItemids = zabbix.item.get( 154 | hostids=[hostid], 155 | output=["name", 156 | "key_", 157 | "value_type", 158 | "hostid", 159 | "status", 160 | "state"], 161 | filter={'key_': 'vm.memory.size[used]'} 162 | ) 163 | memoryUsage = zabbix.history.get(itemids=[memoryItemids[0]['itemid']], history=0, output='extend', 164 | sortfield='clock', 165 | sortorder='ASC', limit=1) 166 | hosts = zabbix.host.get(output=['host', 'hostid', 'name', 'available'], hostids=[hostid], ) 167 | 168 | return [{ 169 | 'host': hosts[0], 170 | 'diskUsage': diskUsage, 171 | 'cpuUsage': cpuUsage, 172 | 'memoryUsage': memoryUsage, 173 | }] 174 | 175 | 176 | def service_history_list(service): 177 | if service: 178 | t_till = int(time.time()) 179 | t_from = t_till - 7 * 24 * 60 * 60 180 | # 所有监控项 181 | items = zabbix.item.get( 182 | output=['itemid'], 183 | filter={'name': service}, 184 | selectHosts=['name', 'host'], 185 | ) 186 | history = [] 187 | for item in items: 188 | history.append( 189 | zabbix.history.get( 190 | itemids=[item['itemid']], 191 | history=3, 192 | output='extend', 193 | sortfield='clock', 194 | sortorder='ASC', 195 | time_from=t_from, 196 | time_till=t_till, 197 | ) 198 | ) 199 | return { 200 | 'items': items, 201 | 'history': history 202 | } 203 | 204 | 205 | def service_item_list(service): 206 | if service: 207 | # 所有监控项 208 | items = zabbix.item.get( 209 | output=['itemid'], 210 | filter={'name': service}, 211 | selectHosts=['name', 'host'], 212 | ) 213 | return items 214 | 215 | 216 | def history_list(itemid): 217 | if itemid: 218 | t_till = int(time.time()) 219 | t_from = t_till - 7 * 24 * 60 * 60 220 | return zabbix.trend.get( 221 | itemids=[itemid], 222 | output='extend', 223 | time_from=t_from, 224 | time_till=t_till, 225 | ) 226 | 227 | 228 | def all_usage(): 229 | diskItemids = zabbix.item.get( 230 | output=["name", 231 | "key_", 232 | "value_type", 233 | "hostid", 234 | "status", 235 | "state"], 236 | filter={'key_': 'vfs.fs.size[/,pfree]'} 237 | ) 238 | diskUsage = zabbix.history.get(itemids=[diskItemids[0]['itemid']], history=0, output='extend', 239 | sortfield='clock', 240 | sortorder='ASC', limit=1) 241 | return None 242 | 243 | 244 | def create_host(group_id, host_name, host_ip, template_id): 245 | host = zabbix.host.create( 246 | host=host_name, 247 | interfaces=[ 248 | { 249 | 'type': 1, 250 | 'main': 1, 251 | 'useip': 1, 252 | 'ip': host_ip, 253 | 'dns': '', 254 | 'port': '10050' 255 | } 256 | ], 257 | groups=[{'groupid': group_id}], 258 | templates=[ 259 | { 260 | 'templateid': template_id, 261 | }, 262 | ] 263 | ) 264 | return host 265 | -------------------------------------------------------------------------------- /monitor-py/monitor/api/zabbix.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/api/zabbix.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/db.sqlite3 -------------------------------------------------------------------------------- /monitor-py/monitor/disk_search.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import time 3 | from pyzabbix import ZabbixAPI 4 | import json 5 | 6 | # 登录zabbix 7 | zabbix = ZabbixAPI('http://172.17.38.107/zabbix') 8 | zabbix.session.verify = False 9 | zabbix.login('Admin', 'zabbix') 10 | 11 | hostid = '10112' 12 | 13 | # 根据主机查询监控项 14 | itemids = zabbix.item.get( 15 | hostids=[hostid], 16 | output=["name", 17 | "key_", 18 | "value_type", 19 | "hostid", 20 | "status", 21 | "state"], 22 | # filter={'key_': 'system.cpu.load[percpu,avg1]'} 23 | ) 24 | 25 | print json.dumps(itemids) 26 | 27 | item = zabbix.item.get(hostids=[hostid], output=["name", "key_", "value_type", "hostid", "status", "state"], 28 | filter={'key_': 'vfs.fs.size[/,free]'}) 29 | 30 | print item 31 | 32 | free_disk_itemid = item[0]['itemid'] 33 | t_till = int(time.time()) 34 | t_from = t_till - 2 * 24 * 60 * 60 35 | 36 | free_disk_data = zabbix.history.get(itemids=[free_disk_itemid], history=3, output='extend', sortfield='clock', 37 | sortorder='ASC', 38 | time_from=t_from, time_till=t_till) 39 | 40 | print json.dumps(free_disk_data) 41 | 42 | item = zabbix.item.get(hostids=[hostid], output=["name", "key_", "value_type", "hostid", "status", "state"], 43 | filter={'key_': 'vfs.fs.size[/,total]'}) 44 | 45 | print item 46 | 47 | total_disk_itemid = item[0]['itemid'] 48 | t_till = int(time.time()) 49 | t_from = t_till - 2 * 24 * 60 * 60 50 | 51 | total_disk_data = zabbix.history.get(itemids=[total_disk_itemid], history=3, output='extend', sortfield='clock', 52 | sortorder='ASC', 53 | time_from=t_from, time_till=t_till) 54 | 55 | print json.dumps(total_disk_data) 56 | -------------------------------------------------------------------------------- /monitor-py/monitor/host.yaml: -------------------------------------------------------------------------------- 1 | - hosts: all 2 | remote_user: root 3 | tasks: 4 | - {name: clean repo, shell: rm -rf /etc/yum.repos.d/*} 5 | - {copy: src=./src/CentOS-Media.repo dest=/etc/yum.repos.d/, name: configure mirrors} 6 | - {name: update repo, shell: yum clean all&yum makecache} 7 | - {name: install zabbix.agent, yum: pkg=zabbix-agent state=latest} 8 | - {name: stop firewalld, service: name=firewalld state=stopped} 9 | - {copy: src=./src/zabbix_agentd.conf dest=/etc/zabbix/, name: copy zabbix-agent} 10 | - {hostname: !!python/unicode 'name='} 11 | - {command: !!python/unicode 'sed -i ''s/vm1//g'' /etc/zabbix/zabbix_agentd.conf', 12 | name: configuration zabbix-agent} 13 | - {name: start zabbix-agent, service: name=zabbix-agent state=started} 14 | -------------------------------------------------------------------------------- /monitor-py/monitor/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "monitor.settings") 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError: 10 | # The above import may fail for some other reason. Ensure that the 11 | # issue is really that Django is missing to avoid masking other 12 | # exceptions on Python 2. 13 | try: 14 | import django 15 | except ImportError: 16 | raise ImportError( 17 | "Couldn't import Django. Are you sure it's installed and " 18 | "available on your PYTHONPATH environment variable? Did you " 19 | "forget to activate a virtual environment?" 20 | ) 21 | raise 22 | execute_from_command_line(sys.argv) 23 | -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/__init__.py -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/__init__.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for monitor project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.11.6. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.11/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | # Quick-start development settings - unsuitable for production 19 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ 20 | 21 | # SECURITY WARNING: keep the secret key used in production secret! 22 | SECRET_KEY = 'msl4i@15i4=z69_cx9qoff-q9kt48ag8&d7&b-txljn(qy@psr' 23 | 24 | # SECURITY WARNING: don't run with debug turned on in production! 25 | DEBUG = True 26 | 27 | ALLOWED_HOSTS = ['*'] 28 | 29 | # Application definition 30 | 31 | INSTALLED_APPS = [ 32 | 'django.contrib.admin', 33 | 'django.contrib.auth', 34 | 'django.contrib.contenttypes', 35 | 'django.contrib.sessions', 36 | 'django.contrib.messages', 37 | 'django.contrib.staticfiles', 38 | 'api.apps.ApiConfig', 39 | 'rest_framework', 40 | 'rest_framework_swagger' 41 | ] 42 | 43 | REST_FRAMEWORK = { 44 | 'DEFAULT_PERMISSION_CLASSES': [ 45 | 46 | ] 47 | } 48 | 49 | MIDDLEWARE = [ 50 | 'django.middleware.security.SecurityMiddleware', 51 | 'django.contrib.sessions.middleware.SessionMiddleware', 52 | 'django.middleware.common.CommonMiddleware', 53 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 54 | 'django.contrib.messages.middleware.MessageMiddleware', 55 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 56 | ] 57 | 58 | ROOT_URLCONF = 'monitor.urls' 59 | 60 | TEMPLATES = [ 61 | { 62 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 63 | 'DIRS': [os.path.join(BASE_DIR, 'templates')], 64 | 'APP_DIRS': True, 65 | 'OPTIONS': { 66 | 'context_processors': [ 67 | 'django.template.context_processors.debug', 68 | 'django.template.context_processors.request', 69 | 'django.contrib.auth.context_processors.auth', 70 | 'django.contrib.messages.context_processors.messages', 71 | ], 72 | }, 73 | }, 74 | ] 75 | 76 | WSGI_APPLICATION = 'monitor.wsgi.application' 77 | 78 | # Database 79 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases 80 | 81 | DATABASES = { 82 | 'default': { 83 | 'ENGINE': 'django.db.backends.sqlite3', 84 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 85 | } 86 | } 87 | 88 | # Password validation 89 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators 90 | 91 | AUTH_PASSWORD_VALIDATORS = [ 92 | { 93 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 94 | }, 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 100 | }, 101 | { 102 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 103 | }, 104 | ] 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'UTC' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | 124 | STATICFILES_DIRS = [ 125 | os.path.join(BASE_DIR, 'static'), 126 | ] 127 | -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/settings.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/settings.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/urls.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | """monitor URL Configuration 3 | 4 | The `urlpatterns` list routes URLs to views. For more information please see: 5 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ 6 | Examples: 7 | Function views 8 | 1. Add an import: from my_app import views 9 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 10 | Class-based views 11 | 1. Add an import: from other_app.views import Home 12 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 13 | Including another URLconf 14 | 1. Import the include() function: from django.conf.urls import url, include 15 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 16 | """ 17 | from django.conf.urls import url, include 18 | from django.contrib import admin 19 | from views import index 20 | from rest_framework_swagger.views import get_swagger_view 21 | 22 | schema_view = get_swagger_view(title='监控系统rest接口') 23 | 24 | urlpatterns = [ 25 | url(r'^admin/', admin.site.urls), 26 | url(r'^api/', include('api.urls')), 27 | url(r'^$', index), 28 | url(r'^swagger/$', schema_view), 29 | ] 30 | -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/urls.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | 4 | def index(request): 5 | return render(request, "index.html") 6 | -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/views.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/views.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for monitor project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "monitor.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /monitor-py/monitor/monitor/wsgi.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/monitor/wsgi.pyc -------------------------------------------------------------------------------- /monitor-py/monitor/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | nohup python manage.py runserver 0.0.0.0:9000 & 3 | -------------------------------------------------------------------------------- /monitor-py/monitor/static/index.html: -------------------------------------------------------------------------------- 1 | 辰安监控
-------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/color-dark.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #242f42; 3 | } 4 | .login-wrap{ 5 | background-image: url("../img/sky.jpg"); 6 | } 7 | .plugins-tips{ 8 | background: #eef1f6; 9 | } 10 | .plugins-tips a{ 11 | color: #20a0ff; 12 | } 13 | .el-upload--text em { 14 | color: #20a0ff; 15 | } 16 | .pure-button{ 17 | background: #20a0ff; 18 | } 19 | -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/datasource.css: -------------------------------------------------------------------------------- 1 | .vue-datasource *{ 2 | box-sizing: border-box; 3 | font-size: 14px; 4 | } 5 | .vue-datasource .panel { 6 | margin-bottom: 22px; 7 | background-color: #fff; 8 | border: 1px solid transparent; 9 | border-radius: 4px; 10 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); 11 | } 12 | .vue-datasource .panel-default { 13 | border-color: #d3e0e9; 14 | } 15 | .vue-datasource .panel-heading { 16 | padding: 10px 15px; 17 | border-bottom: 1px solid transparent; 18 | border-top-right-radius: 3px; 19 | border-top-left-radius: 3px; 20 | } 21 | .vue-datasource .panel-default > .panel-heading { 22 | height:56px; 23 | color: #333333; 24 | background-color: #fff; 25 | border-color: #d3e0e9; 26 | } 27 | .vue-datasource .pull-left { 28 | float: left !important; 29 | } 30 | .vue-datasource .pull-right { 31 | float: right !important; 32 | } 33 | .vue-datasource .form-group { 34 | margin-bottom: 15px; 35 | } 36 | .vue-datasource label { 37 | display: inline-block; 38 | max-width: 100%; 39 | margin-bottom: 5px; 40 | font-weight: bold; 41 | } 42 | .vue-datasource .form-control { 43 | display: block; 44 | width: 100%; 45 | height: 36px; 46 | padding: 6px 12px; 47 | font-size: 14px; 48 | line-height: 1.6; 49 | color: #555555; 50 | background-color: #fff; 51 | background-image: none; 52 | border: 1px solid #ccd0d2; 53 | border-radius: 4px; 54 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 55 | -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 56 | transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; 57 | } 58 | .vue-datasource .btn { 59 | display: inline-block; 60 | margin-bottom: 0; 61 | font-weight: normal; 62 | text-align: center; 63 | vertical-align: middle; 64 | touch-action: manipulation; 65 | cursor: pointer; 66 | background-image: none; 67 | border: 1px solid transparent; 68 | white-space: nowrap; 69 | padding: 6px 12px; 70 | font-size: 14px; 71 | line-height: 1.6; 72 | border-radius: 4px; 73 | -webkit-user-select: none; 74 | -moz-user-select: none; 75 | -ms-user-select: none; 76 | user-select: none; 77 | } 78 | .vue-datasource .btn-primary { 79 | color: #fff; 80 | background-color: #3097D1; 81 | border-color: #2a88bd; 82 | } 83 | .vue-datasource .table { 84 | width: 100%; 85 | max-width: 100%; 86 | margin-bottom: 22px; 87 | border-collapse: collapse; 88 | border-spacing: 0; 89 | text-align: center; 90 | } 91 | .vue-datasource .table > thead > tr > th { 92 | vertical-align: bottom; 93 | border-bottom: 2px solid #ddd; 94 | } 95 | .vue-datasource .table th ,.vue-datasource .table td { 96 | padding: 8px; 97 | line-height: 1.6; 98 | vertical-align: top; 99 | border-top: 1px solid #ddd; 100 | } 101 | .vue-datasource .table-striped > tbody > tr:nth-of-type(odd) { 102 | background-color: #f9f9f9; 103 | } 104 | .vue-datasource .success th ,.vue-datasource .success td{ 105 | background-color: #dff0d8; 106 | } 107 | .vue-datasource .pagination { 108 | display: inline-block; 109 | padding-left: 0; 110 | margin: 22px 0; 111 | border-radius: 4px; 112 | } 113 | .vue-datasource .pagination > li { 114 | display: inline; 115 | } 116 | .pagination > li > a,.pagination > li > span { 117 | position: relative; 118 | float: left; 119 | padding: 6px 12px; 120 | line-height: 1.6; 121 | text-decoration: none; 122 | color: #3097D1; 123 | background-color: #fff; 124 | border: 1px solid #ddd; 125 | margin-left: -1px; 126 | } 127 | .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { 128 | color: #777777; 129 | background-color: #fff; 130 | border-color: #ddd; 131 | cursor: not-allowed; 132 | } 133 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 134 | z-index: 3; 135 | color: #fff; 136 | background-color: #3097D1; 137 | border-color: #3097D1; 138 | cursor: default; 139 | } 140 | .vue-datasource .pagination > li:first-child > a, .vue-datasource .pagination > li:first-child > span { 141 | margin-left: 0; 142 | border-bottom-left-radius: 4px; 143 | border-top-left-radius: 4px; 144 | } 145 | .vue-datasource .text-center { 146 | text-align: center; 147 | } 148 | 149 | 150 | 151 | 152 | @media (min-width: 768px){ 153 | .form-inline .form-group { 154 | display: inline-block; 155 | margin-bottom: 0; 156 | vertical-align: middle; 157 | } 158 | .form-inline .control-label { 159 | margin-bottom: 0; 160 | vertical-align: middle; 161 | } 162 | .form-inline .form-control { 163 | display: inline-block; 164 | width: auto; 165 | vertical-align: middle; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html, body, #app, .wrapper { 7 | width: 100%; 8 | height: 100%; 9 | overflow: hidden; 10 | } 11 | 12 | body { 13 | font-family: "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; 14 | } 15 | 16 | a { 17 | text-decoration: none 18 | } 19 | 20 | .content { 21 | background: none repeat scroll 0 0 #fff; 22 | position: absolute; 23 | left: 250px; 24 | right: 0; 25 | top: 70px; 26 | bottom: 0; 27 | width: auto; 28 | padding: 40px; 29 | box-sizing: border-box; 30 | overflow-y: scroll; 31 | } 32 | 33 | .crumbs { 34 | margin-bottom: 20px; 35 | } 36 | 37 | .pagination { 38 | margin: 20px 0; 39 | text-align: right; 40 | } 41 | 42 | .plugins-tips { 43 | padding: 20px 10px; 44 | margin-bottom: 20px; 45 | } 46 | 47 | .el-button + .el-tooltip { 48 | margin-left: 10px; 49 | } 50 | 51 | .el-table tr:hover { 52 | background: #f6faff; 53 | } 54 | 55 | .mgb20 { 56 | margin-bottom: 20px; 57 | } 58 | 59 | .move-enter-active, .move-leave-active { 60 | transition: opacity .5s; 61 | } 62 | 63 | .move-enter, .move-leave { 64 | opacity: 0; 65 | } 66 | 67 | /*BaseForm*/ 68 | .form-box { 69 | width: 600px; 70 | } 71 | 72 | .form-box .line { 73 | text-align: center; 74 | } 75 | 76 | .el-time-panel__content::after, .el-time-panel__content::before { 77 | margin-top: -7px; 78 | } 79 | 80 | /*Readme*/ 81 | .ms-doc .el-checkbox__input.is-disabled + .el-checkbox__label { 82 | color: #333; 83 | cursor: pointer; 84 | } 85 | 86 | /*Upload*/ 87 | .pure-button { 88 | width: 150px; 89 | height: 40px; 90 | line-height: 40px; 91 | text-align: center; 92 | color: #fff; 93 | border-radius: 3px; 94 | } 95 | 96 | .g-core-image-corp-container .info-aside { 97 | height: 45px; 98 | } 99 | 100 | .el-upload--text { 101 | background-color: #fff; 102 | border: 1px dashed #d9d9d9; 103 | border-radius: 6px; 104 | box-sizing: border-box; 105 | width: 360px; 106 | height: 180px; 107 | text-align: center; 108 | cursor: pointer; 109 | position: relative; 110 | overflow: hidden; 111 | } 112 | 113 | .el-upload--text .el-icon-upload { 114 | font-size: 67px; 115 | color: #97a8be; 116 | margin: 40px 0 16px; 117 | line-height: 50px; 118 | } 119 | 120 | .el-upload--text { 121 | color: #97a8be; 122 | font-size: 14px; 123 | text-align: center; 124 | } 125 | 126 | .el-upload--text em { 127 | font-style: normal; 128 | } 129 | 130 | /*VueEditor*/ 131 | .ql-container { 132 | min-height: 400px; 133 | } 134 | 135 | .ql-snow .ql-tooltip { 136 | transform: translateX(117.5px) translateY(10px) !important; 137 | } 138 | 139 | .editor-btn { 140 | margin-top: 20px; 141 | } 142 | 143 | 144 | .ivu-timeline-item-tail { 145 | height: 100%; 146 | border-left: 1px dotted purple !important; 147 | position: absolute; 148 | left: 6px; 149 | top: 0; 150 | } 151 | -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/theme-green/color-green.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #00d1b2; 3 | } 4 | .login-wrap{ 5 | background: rgba(56, 157, 170, 0.82);; 6 | } 7 | .plugins-tips{ 8 | background: #f2f2f2; 9 | } 10 | .plugins-tips a{ 11 | color: #00d1b2; 12 | } 13 | .el-upload--text em { 14 | color: #00d1b2; 15 | } 16 | .pure-button{ 17 | background: #00d1b2; 18 | } 19 | .vue-datasource .btn-primary { 20 | color: #fff; 21 | background-color: #00d1b2 !important; 22 | border-color: #00d1b2 !important; 23 | } 24 | .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { 25 | background-color: #00d1b2 !important; 26 | border-color: #00d1b2 !important; 27 | } -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/theme-green/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/css/theme-green/fonts/element-icons.ttf -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/css/theme-green/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/css/theme-green/fonts/element-icons.woff -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/fonts/element-icons.b02bdc1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/fonts/element-icons.b02bdc1.ttf -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/fonts/ionicons.05acfdb.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/fonts/ionicons.05acfdb.woff -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/fonts/ionicons.24712f6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/fonts/ionicons.24712f6.ttf -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/fonts/ionicons.2c2ae06.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/fonts/ionicons.2c2ae06.eot -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/img.2aab7b4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/img.2aab7b4.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/img.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/mongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/mongo.png -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/mysql.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/mysql.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/mysql.png -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/oracle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/oracle.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/oracle2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/oracle2.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/redis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/redis.png -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/sky.871d198.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/sky.871d198.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/sky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/sky.jpg -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/img/tomcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/monitor-py/monitor/static/static/img/tomcat.png -------------------------------------------------------------------------------- /monitor-py/monitor/static/static/js/0.4836f94b3c25f7f992e3.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{1905:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{tableData:[],cur_page:1,multipleSelection:[],select_cate:"",select_word:"",del_list:[],is_search:!1}},created:function(){this.getData()},methods:{handleCurrentChange:function(t){this.cur_page=t,this.getData()},getData:function(){var t=this;t.$http.get("/api/groups/").then(function(e){t.tableData=e.data})},search:function(){this.is_search=!0},formatter:function(t,e){return t.address},filterTag:function(t,e){return e.tag===t},hostDetail:function(t,e){},handleDelete:function(t,e){this.$message.error("删除第"+(t+1)+"行")},delAll:function(){var t=this,e=t.multipleSelection.length,i="";t.del_list=t.del_list.concat(t.multipleSelection);for(var a=0;a辰安监控
-------------------------------------------------------------------------------- /pic/pic/agent-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/agent-deploy.png -------------------------------------------------------------------------------- /pic/pic/apache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/apache.png -------------------------------------------------------------------------------- /pic/pic/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/dashboard.png -------------------------------------------------------------------------------- /pic/pic/dashboard1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/dashboard1.png -------------------------------------------------------------------------------- /pic/pic/dashboard2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/dashboard2.png -------------------------------------------------------------------------------- /pic/pic/event.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/event.png -------------------------------------------------------------------------------- /pic/pic/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/group.png -------------------------------------------------------------------------------- /pic/pic/host-detail1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/host-detail1.png -------------------------------------------------------------------------------- /pic/pic/host-detail2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/host-detail2.png -------------------------------------------------------------------------------- /pic/pic/host-detail3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/host-detail3.png -------------------------------------------------------------------------------- /pic/pic/host-detail4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/host-detail4.png -------------------------------------------------------------------------------- /pic/pic/host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/host.png -------------------------------------------------------------------------------- /pic/pic/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/login.png -------------------------------------------------------------------------------- /pic/pic/rest-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangll99/zabbix-monitor/687c152e5e6bc37e09bc65ca6da65330f9c40bf3/pic/pic/rest-api.png -------------------------------------------------------------------------------- /部署文档.md: -------------------------------------------------------------------------------- 1 | ## 部署文档 2 | 3 | 1: 下载工程源代码 4 | 5 | git clone https://github.com/huangll99/zabbix-monitor.git 6 | 7 | 2: 编译前端vue工程 8 | 9 | cd zabbix-monitor/monitor-py/monitor 10 | 11 | 需要提前安装npm 12 | 13 | 运行 npm install 安装依赖包 14 | 15 | 运行npm run build 编译打包前端工程,dist目录中是打包结果物 16 | 17 | 3: 部署python工程 18 | 19 | 将dist目录中的文件,放入[zabbix-monitor](https://github.com/huangll99/zabbix-monitor)/[monitor-py](https://github.com/huangll99/zabbix-monitor/tree/master/monitor-py)/[monitor](https://github.com/huangll99/zabbix-monitor/tree/master/monitor-py/monitor)/**static**/ 目录下 20 | 21 | 使用pip install 安装相关python依赖包(django,pyzabbix,rest_framework,rest_framework_swagger) 22 | 23 | 启动工程 运行zabbix-monitor/monitor-py/monitor/ 下的start.sh 24 | 25 | --------------------------------------------------------------------------------