diff --git a/README.md b/README.md index dc78e3f..f34a41a 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # APO-Dashboard +Mountain View + Source Code for APO Dashboards diff --git a/web/app.js b/web/app.js index c2e4fbc..db74e05 100755 --- a/web/app.js +++ b/web/app.js @@ -6,7 +6,7 @@ var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var config = require('./config'); var async = require('async'); - +var http = require('http'); // Database @@ -29,7 +29,8 @@ var routes = require('./routes/index'); var ngas = require('./routes/ngas'); var charts = require('./routes/charts'); var oracle = require('./routes/oracle') - +var topusers = require('./routes/topusers'); +var map = require('./routes/map'); var api = require('./routes/api'); var app = express(); @@ -63,6 +64,9 @@ app.use('/ngas',ngas); app.use('/charts',charts); app.use('/oracle',oracle); app.use('/api',api); +app.use('/topusers',topusers); +app.use('/map',map); + // catch 404 and forward to error handler diff --git a/web/routes/index.js b/web/routes/index.js index 65a93bf..b31942c 100755 --- a/web/routes/index.js +++ b/web/routes/index.js @@ -1,8 +1,8 @@ var express = require('express'); var router = express.Router(); var async = require('async'); -var mongodb = require('mongodb') - +var mongodb = require('mongodb'); +var http = require('http'); /* GET home page. */ @@ -260,12 +260,14 @@ router.get('/', function(req, res) + ], //start dealing with responses from db function(err,results) { + if (err){console.log(err); return res.send(400);} /////////////////////////////////////////////// @@ -372,23 +374,34 @@ router.get('/', function(req, res) - var xmlscoused = Number(data15[0]["data"][0]["mbused"]) - var xmlscofree = Number(data15[0]["data"][0]["mbfree"]) - var xmlsconotall = Number(data15[0]["data"][0]["mbnotall"]) - var xmlscototal = Number(data15[0]["data"][0]["mbtotal"]) - var xmlscofull = Number(data15[0]["data"][0]["mbtotal"]) + xmlsconotall + var xmlscoused = (Number(data15[0]["data"][0]["mbused"])/1024).toFixed(2) + var xmlscofree = (Number(data15[0]["data"][0]["mbfree"])/1024).toFixed(2) + var xmlsconotall = (Number(data15[0]["data"][0]["mbnotall"])/1024).toFixed(2) + var xmlscototal = (Number(data15[0]["data"][0]["mbtotal"])/1024).toFixed(2) + var xmlscofull = ((Number(data15[0]["data"][0]["mbtotal"])+ Number(xmlsconotall))/1024).toFixed(2) //contains not allocated space - var xmlscofreefull = xmlscofree + xmlsconotall + var xmlscofreefull = (Number(xmlscofree) + Number(xmlsconotall)/1024).toFixed(2) + + - var xmlosfused = Number(data16[0]["data"][0]["mbused"]) - var xmlosffree = Number(data16[0]["data"][0]["mbfree"]) - var xmlosfnotall = Number(data16[0]["data"][0]["mbnotall"]) - var xmlosftotal = Number(data16[0]["data"][0]["mbtotal"]) - var xmlosffull = Number(data16[0]["data"][0]["mbtotal"]) + xmlosfnotall + var xmlosfused = (Number(data16[0]["data"][0]["mbused"])/1024).toFixed(2) + var xmlosffree = (Number(data16[0]["data"][0]["mbfree"])/1024).toFixed(2) + var xmlosfnotall = (Number(data16[0]["data"][0]["mbnotall"])/1024).toFixed(2) + var xmlosftotal = (Number(data16[0]["data"][0]["mbtotal"])/1024).toFixed(2) + var xmlosffull = Number(xmlosftotal) + Number(xmlosfnotall) //contains not allocated space - var xmlosffreefull = xmlosffree + xmlosfnotall - + var xmlosffreefull = Number(xmlosffree) + Number(xmlosfnotall) + + + console.log(xmlosfused) + console.log(xmlosffree) + console.log(xmlosfnotall) + console.log(xmlosftotal) + console.log(xmlosffull) + console.log(xmlosffreefull) + + var xmlscostatus = "OK" if (xmlscofreefull < 32 && xmlscofreefull > 3 ) {xmlscostatus = "WARNING"} else if (xmlscofreefull <= 3) {xmlscostatus = "CRITICAL"} diff --git a/web/routes/oracle.js b/web/routes/oracle.js index 5b5cdf7..11c0678 100644 --- a/web/routes/oracle.js +++ b/web/routes/oracle.js @@ -68,7 +68,7 @@ router.get('/', function(req, res) { function(callback){ var db = req.db; var collection = db.collection('oraclestatus'); - collection.find({}).sort({timestamp:-1}).limit(10).toArray(function(err,result){ + collection.find({}).sort({timestamp:-1}).limit(30).toArray(function(err,result){ if (err){ console.log(err); diff --git a/web/routes/topusers.js b/web/routes/topusers.js index 6b2cbaf..1c31ce6 100644 --- a/web/routes/topusers.js +++ b/web/routes/topusers.js @@ -1,451 +1,110 @@ var express = require('express'); var mongodb = require('mongodb'); var async = require('async'); - - var router = express.Router(); -var MongoClient = mongodb.MongoClient; - -var url = 'mongodb://localhost:27017/test' - -var dbObject; - -MongoClient.connect(url,function(err,db) - { - if (err) {console.log("unable to connecto to mongodb,error",err);} - else {console.log("connection stablished");} - dbObject = db; -}); - - -router.get('/ngas', function(req,res) - { - async.parallel([ - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"ngasSpace",ngascluster:"sco"}).sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"ngasSpace",ngascluster:"osfBE"}).sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"ngasSpace",ngascluster:"osfFE"}).sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"ngasSpace",ngascluster:"sco"}).limit(10).sort({timestamp:-1}).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('ngaspartitionsosffe'); - collection.find().sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('ngaspartitionsosfbe'); - collection.find().sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('ngaspartitionssco'); - collection.find().sort({timestamp:-1}).limit(1).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - } - - - - - - ], - - function(err,results) - { - if (err) - { - console.log(err); - return res.send(400); - } - data1 = results[0] - data2 = results[1] - data3 = results[2] - data4 = results[3] - data5 = results[4] - data6 = results[5] - data7 = results[6] - console.log(data4) - - var temp = [] - for (index in data4) - { - var results = data4[index]; - var timestamp = results["timestamp"]; - var value = results["usedsize"]; - temp.push({y:index, item1:value}); - } - console.log(temp) +var request = require('request'); +router.get('/', function(req, res) { + + var pingESOarcdb2 = { + url: 'https://prtg.alma.cl/api/getsensordetails.json?username=monarcs&password=a1maarcs&id=4703', + "rejectUnauthorized": false, + } - res.render('scripts/ngas', { - "scoused": data1[0]["usedsize"],"scototal":data1[0]["totsize"], - "osfBEused": data2[0]["usedsize"],"osfBEtotal":data2[0]["totsize"], - "osfFEused": data3[0]["usedsize"],"osfFEtotal":data3[0]["totsize"], - scoplot:temp, - "osffetable":data5[0]["data"], - "osfbetable":data6[0]["data"], - "scotable":data7[0]["data"] - }); - }); -}); - - - -router.get('/oracle', function(req, res) { - - async.parallel([ - function(callback){ - var collection = dbObject.collection('tablespacessco'); - collection.find().sort({timestamp:-1}).limit(1).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - function(callback){ - var collection = dbObject.collection('tablespacesosf'); - collection.find().sort({timestamp:-1}).limit(1).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, - - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"oracleStatus",server:"osf"}).sort({timestamp:-1}).limit(1).toArray(function(err,result){ - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, + var pingESOora04 = { + url: 'https://prtg.alma.cl/api/getsensordetails.json?username=monarcs&password=a1maarcs&id=4705', + "rejectUnauthorized": false, + } - function(callback){ - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"oracleStatus",server:"sco"}).sort({timestamp:-1}).limit(1).toArray(function(err,result){ + var pingNAOJ = { + url: 'https://prtg.alma.cl/api/getsensordetails.json?username=monarcs&password=a1maarcs&id=4710', + "rejectUnauthorized": false, + } - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - }, + var pingNRAO = { + url: 'https://prtg.alma.cl/api/getsensordetails.json?username=monarcs&password=a1maarcs&id=4712', + "rejectUnauthorized": false, + } - function(callback){ - var collection = dbObject.collection('oraclestatus'); - collection.find({}).sort({timestamp:-1}).limit(10).toArray(function(err,result){ - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - else {console.log("no se encontro nada");} - callback(null,result); - }); - } + var bandwidth = { + url: 'https://prtg.alma.cl/api/getsensordetails.json?username=monarcs&password=a1maarcs&id=5945', + "rejectUnauthorized": false, + } - ], - function(err,results){ - if (err){ - console.log(err); - return res.send(400); - } - data1 = results[0][0]["data"] - data2 = results[1][0]["data"] - data3 = results[2] - data4 = results[3] - data5 = results[4] - console.log(data3[0]["status"]) - res.render('scripts/oracle',{"userlist": data1,"userlist2": data2,"osfstatus":data3[0]["status"],"scostatus":data4[0]["status"],data5:data5}); - + request(pingESOarcdb2,function(error,response,body) + { + if (error) + { + console.log(error) + return + } + var obj = JSON.parse(body) + console.log("ping ESO arcdb2") + console.log(obj["sensordata"]["lastvalue"]) }); -}); - - - -router.get('/topusers', function(req, res) { - - res.render('scripts/topusers'); -}); - - -router.get('/casaops', function(req, res) { - - res.render('scripts/casaops'); -}); - - -router.get('/charts', function(req,res){ - - - async.parallel([ - //last 30 items are recovered - function(callback){ - var collection = dbObject.collection('datasize'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - - - function(callback){ - var collection = dbObject.collection('datasize365'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - - function(callback){ - var collection = dbObject.collection('asdms'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - - - function(callback){ - var collection = dbObject.collection('asdms365'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - - function(callback){ - var collection = dbObject.collection('ingestionsco'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - }, - - - function(callback){ - var collection = dbObject.collection('ingestionosf'); - collection.find().sort({date:-1}).limit(30).toArray(function(err,result){ - - if (err){ - console.log(err); - callback(err); - } - else if (result.length){console.log("Hay tabla");} - callback(null,result); - }); - } - - - - ], - - - function(err,results){ - if (err){ - console.log(err); - return res.send(400); - } - res1 = results[0] - res2 = results[1] - res3 = results[2] - res4 = results[3] - res5 = results[4] - res6 = results[5] - var data1 = []; - var data2 = []; - var data3 = []; - var data4 = []; - - console.log(res5) - - - //looping the result array in reversed order, so the last 30 items will be passed to jade. same for all charts. - for (var i = res1.length-1;i>=0;i--) + request(pingESOora04,function(error,response,body) + { + if (error) { - var formatedResult = res1[i]; - var date = formatedResult["date"]; - var tar= formatedResult["tar"]; - var science = formatedResult["science"] - //var date = results[0]["date"]; - //var tar= results[0]["tar"]; - //var science = results[0]["science"]; - data1.push({x:date, ytar:tar,yscience:science}); + console.log(error) + return } - - for (var i = res2.length-1;i>=0;i--) + var obj = JSON.parse(body) + console.log("ping ESO ora04") + console.log(obj["sensordata"]["lastvalue"]) + }); + + request(pingNAOJ,function(error,response,body) + { + if (error) { - var formatedResult = res2[i]; - var date = formatedResult["date"]; - var tar= formatedResult["tar"]; - var science = formatedResult["science"] - //var date = results[0]["date"]; - //var tar= results[0]["tar"]; - //var science = results[0]["science"]; - data2.push({x:date, ytar:tar,yscience:science}); + console.log(error) + return } - - - - for (var i = res3.length-1;i>=0;i--) + var obj = JSON.parse(body) + console.log("ping NAOJ") + console.log(obj["sensordata"]["lastvalue"]) + }); + + request(pingNRAO,function(error,response,body) + { + if (error) { - var formatedResult = res3[i]; - var date = formatedResult["date"]; - var csv= formatedResult["csv"]; - var science = formatedResult["science"] - //var date = results[0]["date"]; - //var tar= results[0]["tar"]; - //var science = results[0]["science"]; - data3.push({x:date, ycsv:csv,yscience:science}); + console.log(error) + return } + var obj = JSON.parse(body) + console.log("ping NRAO") + console.log(obj["sensordata"]["lastvalue"]) + }); - - for (var i = res4.length-1;i>=0;i--) + + request(bandwidth,function(error,response,body) + { + if (error) { - var formatedResult = res4[i]; - var date = formatedResult["date"]; - var csv= formatedResult["csv"]; - var science = formatedResult["science"] - //var date = results[0]["date"]; - //var tar= results[0]["tar"]; - //var science = results[0]["science"]; - data4.push({x:date, ycsv:csv,yscience:science}); + console.log(error) + return } + var obj = JSON.parse(body) + console.log(obj) + }); - res.render('scripts/charts',{data1:data1,data2:data2,data3:data3,data4:data4,"res5":res5,"res6":res6}); - - }); -}) -router.get('/filesInFENotInBE', function(req,res) - { - - var collection = dbObject.collection('monitoring'); - collection.find({servicename:"fileInFENotInBE"}).limit(40).toArray(function(err,result) - { - if (err){console.log(err);} - else if (result.length){console.log("Hay resultados");} - else {console.log("no se encontro nada");} - var timestampArray = []; - var valueArray = []; - var data = []; - console.log(result) - for (index in result) - { - console.log(index) - var results = result[index]; - var timestamp = results["timestamp"]; - var value = results["pendingfiles"]; - data.push({y:index, item1:value}); - } - - //console.log(results); - console.log(data); - res.render('scripts/filesInFENotInBE', {data: data}); - - - }); + + res.render('topusers') }); diff --git a/web/views/charts.jade b/web/views/charts.jade index 08e9885..e9b1b0e 100755 --- a/web/views/charts.jade +++ b/web/views/charts.jade @@ -150,7 +150,9 @@ block javascript xkey: 'x', ykeys: ['ytar','yscience'], labels: ['TAR','Science'], - stacked: 'true' + stacked: 'true', + hideHover: 'auto', + barColors: ["#0098ef", "#00a65a"] }); Morris.Bar({ element: 'bar-chart2', @@ -158,7 +160,9 @@ block javascript xkey: 'x', ykeys: ['ytar','yscience'], labels: ['TAR','Science'], - stacked: 'true' + stacked: 'true', + hideHover: 'auto', + barColors: ["#0098ef", "#00a65a"] }); Morris.Bar({ @@ -167,7 +171,9 @@ block javascript xkey: 'x', ykeys: ['ycsv','yscience'], labels: ['CSV','Science'], - stacked: 'true' + stacked: 'true', + hideHover: 'auto', + barColors: ["#0098ef", "#00a65a"] }); Morris.Bar({ @@ -176,7 +182,9 @@ block javascript xkey: 'x', ykeys: ['ycsv','yscience'], labels: ['CSV','Science'], - stacked: 'true' + stacked: 'true', + hideHover: 'auto', + barColors : ["#0098ef", "#00a65a"] }); diff --git a/web/views/index.jade b/web/views/index.jade index b09d5ed..a371ac3 100755 --- a/web/views/index.jade +++ b/web/views/index.jade @@ -17,13 +17,13 @@ block content .col-sm-6 .box.box-solid.box-info .box-header - h2.box-title ASDMs Ingested last 15 days + h2.box-title Data ingested last 15 days .box-body.chart-responsive #bar-chart1.chart(style='height: 150px;') .col-lg-6 .box.box-solid.box-info .box-header - h2.box-title Data Ingested last 15 days + h2.box-title ASDMs Ingested last 15 days .box-body.chart-responsive #bar-chart2.chart(style='height: 150px;') @@ -107,32 +107,9 @@ block content i.fa.fa-warning - .col-sm-6 - .box.box-solid.box-info.no-padding - .box-header - h3.box-title NGAS Status - .box-body.no-padding - .box-body.table-responsive.no-padding - table.table.table-hover - tr - th Service name - th Status - tr - td NGAS SCO - td - span.label.label-success OK - tr - td NGAS OSF - td - span.label.label-success OK - tr - td NGAS OSF TestBench - td - span.label.label-success OK - - .col-sm-6 + .col-sm-12 .box.box-solid.box-info.no-padding .box-header h2.box-title NGAS Total load @@ -140,21 +117,21 @@ block content .clearfix span.pull-left SCO - var percentage = Math.round(scoused/scototal*100) - smal.pull-right #{scoused} / #{scototal} GB (#{percentage}) % + smal.pull-right #{scoused} / #{scototal} TB (#{percentage}) % .progress.xs .progress-bar.progress-bar-aqua(style='width: #{percentage}%') .clearfix span.pull-left OSF BackEnd - var percentage = Math.round(osfBEused/osfBEtotal*100) - smal.pull-right #{osfBEused} / #{osfBEtotal} GB (#{percentage})% + smal.pull-right #{osfBEused} / #{osfBEtotal} TB (#{percentage})% .progress.xs .progress-bar.progress-bar-aqua(style='width: #{percentage}%') .clearfix span.pull-left OSF FrontEnd - var percentage = Math.round(osfFEused/osfFEtotal*100) - smal.pull-right #{osfFEused} / #{osfFEtotal} GB (#{percentage})% + smal.pull-right #{osfFEused} / #{osfFEtotal} TB (#{percentage})% .progress.xs .progress-bar.progress-bar-aqua(style='width: #{percentage}%') @@ -172,9 +149,8 @@ block content i.fa.fa-file-o .a.small-box-footer(href='#') | Number of files - i.fa.fa-arrow-circle-right .col-lg-3 - .small-box.bg-green + .small-box.bg-aqua .inner h3 | #{zerobytes} Files @@ -182,12 +158,11 @@ block content | Zero Bytes Files .icon i.fa.fa-file-o - .a.small-box-footer(href='#') + .a.small-box-footer | Number of files - i.fa.fa-arrow-circle-right .col-lg-3 - .small-box.bg-yellow + .small-box.bg-aqua .inner h3 | #{archivesize} TB @@ -195,10 +170,8 @@ block content | DB SCO Archive Size .icon i.fa.fa-cube - .a.small-box-footer(href='index') - | Number of files - i.fa.fa-arrow-circle-right - + .a.small-box-footer + | Disk used .col-lg-3 .small-box.bg-aqua .inner @@ -210,7 +183,6 @@ block content i.fa.fa-file-o .a.small-box-footer(href='index') | Number of files - i.fa.fa-arrow-circle-right .col-lg-6 @@ -221,7 +193,7 @@ block content - var scog3status = scog3statusjs if scog3status == "OK" .clearfix - span.pull-left SCO ASM GROUP3 + span.pull-left SCO ASM GROUP3, #{group3scofree} GB Free - var group3scoused = Math.round(group3scototal-group3scofree) - var percentage = Math.round(group3scoused/group3scototal*100) smal.pull-right #{Math.round(group3scoused)} / #{Math.round(group3scototal)} GB (#{percentage})% @@ -230,7 +202,7 @@ block content else if scog3status == "WARNING" .clearfix - span.pull-left SCO ASM GROUP3 + span.pull-left SCO ASM GROUP3, #{group3scofree} GB Free - var group3scoused = Math.round(group3scototal-group3scofree) - var percentage = Math.round(group3scoused/group3scototal*100) smal.pull-right #{Math.round(group3scoused)} / #{Math.round(group3scototal)} GB (#{percentage})% @@ -239,7 +211,7 @@ block content else if scog3status == "CRITICAL" .clearfix - span.pull-left SCO ASM GROUP3 + span.pull-left SCO ASM GROUP3, #{group3scofree} GB Free - var group3scoused = Math.round(group3scototal-group3scofree) - var percentage = Math.round(group3scoused/group3scototal*100) smal.pull-right #{Math.round(group3scoused)} / #{Math.round(group3scototal)} GB (#{percentage})% @@ -251,7 +223,7 @@ block content - var scog6status = scog6statusjs if scog6status == "OK" .clearfix - span.pull-left SCO ASM GROUP6 + span.pull-left SCO ASM GROUP6, #{group6scofree} GB Free - var group6scoused = Math.round(group6scototal-group6scofree) - var percentage = Math.round(group6scoused/group6scototal*100) smal.pull-right #{Math.round(group6scoused)} / #{Math.round(group6scototal)} GB (#{percentage})% @@ -260,7 +232,7 @@ block content else if scog6status == "WARNING" .clearfix - span.pull-left SCO ASM GROUP6 + span.pull-left SCO ASM GROUP6, #{group6scofree} GB Free - var group6scoused = Math.round(group6scototal-group6scofree) - var percentage = Math.round(group6scoused/group6scototal*100) smal.pull-right #{Math.round(group6scoused)} / #{Math.round(group6scototal)} GB (#{percentage})% @@ -269,7 +241,7 @@ block content else if scog6status == "CRITICAL" .clearfix - span.pull-left SCO ASM GROUP6 + span.pull-left SCO ASM GROUP6, #{group6scofree} GB Free - var group6scoused = Math.round(group6scototal-group6scofree) - var percentage = Math.round(group6scoused/group6scototal*100) smal.pull-right #{Math.round(group6scoused)} / #{Math.round(group6scototal)} GB (#{percentage})% @@ -281,7 +253,7 @@ block content - var osfg3status = osfg3statusjs if osfg3status == "OK" .clearfix - span.pull-left OSF ASM GROUP3 + span.pull-left OSF ASM GROUP3, #{group3osffree} Free GB - var group3osfused = Math.round(group3osftotal-group3osffree) - var percentage = Math.round(group3osfused/group3osftotal*100) smal.pull-right #{Math.round(group3osfused)} / #{Math.round(group3osftotal)} gb (#{percentage})% @@ -290,7 +262,7 @@ block content if osfg3status == "WARNING" .clearfix - span.pull-left OSF ASM GROUP3 + span.pull-left OSF ASM GROUP3, #{group3osffree} Free GB - var group3osfused = Math.round(group3osftotal-group3osffree) - var percentage = Math.round(group3osfused/group3osftotal*100) smal.pull-right #{Math.round(group3osfused)} / #{Math.round(group3osftotal)} gb (#{percentage})% @@ -299,7 +271,7 @@ block content if osfg3status == "CRITICAL" .clearfix - span.pull-left OSF ASM GROUP3 + span.pull-left OSF ASM GROUP3, #{group3osffree} Free GB - var group3osfused = Math.round(group3osftotal-group3osffree) - var percentage = Math.round(group3osfused/group3osftotal*100) smal.pull-right #{Math.round(group3osfused)} / #{Math.round(group3osftotal)} gb (#{percentage})% @@ -311,7 +283,7 @@ block content - var osfg6status = osfg6statusjs if osfg6status == "OK" .clearfix - span.pull-left OSF ASM GROUP6 + span.pull-left OSF ASM GROUP6, #{group6osffree} Free GB - var group6osfused = Math.round(group6osftotal-group6osffree) - var percentage = Math.round(group6osfused/group6osftotal*100) smal.pull-right #{Math.round(group6osfused)} / #{Math.round(group6osftotal)} GB (#{percentage})% @@ -320,7 +292,7 @@ block content if osfg6status == "WARNING" .clearfix - span.pull-left OSF ASM GROUP6 + span.pull-left OSF ASM GROUP6, #{group6osffree} Free GB - var group6osfused = Math.round(group6osftotal-group6osffree) - var percentage = Math.round(group6osfused/group6osftotal*100) smal.pull-right #{Math.round(group6osfused)} / #{Math.round(group6osftotal)} GB (#{percentage})% @@ -330,7 +302,7 @@ block content if osfg6status == "CRITICAL" .clearfix - span.pull-left OSF ASM GROUP6 + span.pull-left OSF ASM GROUP6, #{group6osffree} Free GB - var group6osfused = Math.round(group6osftotal-group6osffree) - var percentage = Math.round(group6osfused/group6osftotal*100) smal.pull-right #{Math.round(group6osfused)} / #{Math.round(group6osftotal)} GB (#{percentage})% @@ -469,7 +441,7 @@ block javascript labels: ['TAR','Science'], stacked: 'true', hideHover: 'auto', - barColors: ["#f56954", "#00a65a"] + barColors: ["#0098ef", "#00a65a"] }); @@ -481,7 +453,7 @@ block javascript labels: ['CSV','Science'], stacked: 'true', hideHover: 'auto', - barColors: ["#f56954", "#00a65a"] + barColors: ["#0098ef", "#00a65a"] }); @@ -497,138 +469,3 @@ block javascript salesByState.render(); }); - - FusionCharts.ready(function(){ - var salesByState = new FusionCharts({ - "type": "maps/world", - "renderAt": "chartContainer", - "width": "800", - "height": "600", - "dataFormat": "json", - "dataSource": { - "chart": { - "caption": "ARCS Map", - "subcaption": "Link State", - "showCanvasBorder" : "1", - "bgImageAlpha" : "100", - //"entityFillHoverColor": "#fffff", - //"numberScaleValue": "1,1000,1000", - //"numberScaleUnit": "K,M,B", - "markerBgColor": "FF0000", - "markerRadius": "10", - "viewMode" : "0", - "showMarkerLabels": "1", - //"numberPrefix": "$", - //"showLabels": "1", - "theme": "zune" - }, - - - "markers": { - "items": [ - { - "id": "eso", - "shapeid": "hdo-shape", - "x": "430.23", - "y": "125.9", - "label": "ESO", - "tooltext": "European Southern Observatory", - "labelpos": "top" - }, - { - "id": "naoj", - "shapeid": "hdo-shape", - "x": "630.23", - "y": "170.9", - "label": "NAOJ", - "tooltext": "National Astronomical Observatory of Japan", - "labelpos": "bottom" - }, - { - "id": "nrao", - "shapeid": "hdo-shape", - "x": "180.23", - "y": "150.9", - "label": "NRAO", - "tooltext": "National Radio Astronomy Observatory", - "labelpos": "top" - }, - { - "strength": "3", - "id": "sco", - "shapeid": "hdo-shape", - "x": "180.23", - "y": "350.9", - "label": "OSF", - "tooltext": "Santiago Central Office", - "labelpos": "top" - }], - - - - - "connectors": [ - { - - "from": "sco", - "to": "nrao", - "tooltext": "ping: 138 ms", - "dashed": "0", - "strength" : "10", - "thickness" : "10", - "color": "00577F", - "alpha": "60", - "showHoverEffect" : "0", - "hoverThickness" : "50" - }, - { - "from": "sco", - "to": "naoj", - "tooltext": "ping: 256 ms", - "dashed": "0", - "showHoverEffect" : "0", - "thickness" : "10", - "color": "00577F", - "alpha": "60" - }, - { - "from": "sco", - "to": "eso", - "tooltext": "ping arcdb2.hq.eso.org: 246 ms
ping ora04.hq.eso.org = 274", - "dashed": "0", - "thickness" : "10", - "color": "00577F", - "alpha": "60", - "showHoverEffect" : "0" - } - - ], - - "shapes": [ - { - "id": "hdo-shape", - "type": "circle", - "radius": "10", - "fillcolor": "ffffff,6baa01", - "fillAlpha": "100,40", - "fillRatio": "10,50", - "fillPattern": "RADIAL", - "borderColor": "#666666", - "borderThickness": "3", - "borderAlpha": "80" - } - ] - }, - - "data": [ - { - "id": "NA" - }, - { - "id": "EU" - } - ] - } - }) - salesByState.render() - }) diff --git a/web/views/layout.jade b/web/views/layout.jade index c7ae817..6ce5130 100755 --- a/web/views/layout.jade +++ b/web/views/layout.jade @@ -3,6 +3,8 @@ html head meta(charset='UTF-8') title APO | Dashboard + //refresh every half hour + meta(http-equiv="refresh" content="1800") meta(content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no', name='viewport') // bootstrap 3.0.2 link(href='/css/bootstrap.min.css', rel='stylesheet', type='text/css') @@ -69,17 +71,15 @@ html a(href='oracle') i.fa.fa-database | ORACLE - a(href='casaops') - i.fa.fa-angle-double-right - | CASA/SCIOPS a(href='topusers') i.fa.fa-file | Top Users a(href='charts') i.fa.fa-bar-chart - | Charts - a(href='hardware-failures') - + | Ingestion Charts + a(href='map') + i.fa.fa-map + | Network Status // /.sidebar diff --git a/web/views/ngas.jade b/web/views/ngas.jade index 25aa8c8..6a22101 100755 --- a/web/views/ngas.jade +++ b/web/views/ngas.jade @@ -16,9 +16,9 @@ block content // Small boxes (Stat box) .row // Left col - section.col-lg-6.connectedSortable + section.col-lg-12 // Box (with bar chart) - #loading-example.box.box-danger + .box.box-solid.box-info .box-header h3.box-title Server Load // /.box-header @@ -48,34 +48,6 @@ block content // /.pad // /.col // /.row - inside box - section.col-lg-6.connectedSortable - .box.box-danger - .box-header - h3.box-title NGAS Status - .box-body.no-padding - .box-body.table-responsive.no-padding - table.table.table-hover - tr - th Service Name - th Status - tr - td NGAS SCO - td - span.label.label-warning NO DATA - tr - td NGAS OSF - td - span.label.label-warning NO DATA - tr - td OSF TestBench - td - span.label.label-warning NO DATA - // /.box-body - // /.box - // Custom tabs (Charts with tabs) - - // right col - // /.row (main row) .row section.col-lg-4.coonectedSortable @@ -108,14 +80,14 @@ block content span.label.label-danger Danger tr section.col-lg-4.connectedSortable - #loading-example.box.box-solid.box-info + .box.box-solid.box-info .box-header .pull-right.box-tools button.btn.btn-info.btn-sm(data-widget='collapse',data-toggle='tooltip',title='Collapse') i.fa.fa-minus h3.box-title NGAS OSF BackEnd Partitions .box-body.table-responsive - table#example2.table.table-bordered.table-hover + table.table.table-bordered.table-hover thead tr th Host @@ -145,7 +117,7 @@ block content button.btn.btn-info.btn-sm(data-widget='collapse',data-toggle='tooltip',title='Collapse') i.fa.fa-minus h3.box-title NGAS SCO Partitions - #chat-box.box-body.table-responsive + box-body.table-responsive table.table.table-bordered.table-hover thead tr @@ -154,7 +126,7 @@ block content th Used % th Status tbody - each column, i in scotable + each column in scotable td #{column.name} td #{column.partition} td #{column.percused} diff --git a/web/views/oracle.jade b/web/views/oracle.jade index 6636a66..65dc000 100755 --- a/web/views/oracle.jade +++ b/web/views/oracle.jade @@ -13,55 +13,6 @@ block content li.active Dashboard // Main content section.content - // Small boxes (Stat box) - .row - // Left col - section.col-lg-6.connectedSortable - // Box (with bar chart) - #loading-example.box.box-solid.box-info - .box-header - .pull-right.box-tools - button.btn.btn-info.btn-sm(data-widget='collapse',data-toggle='tooltip',title='Collapse') - i.fa.fa-minus - h3.box-title Server Load - .box-body - .box-body.table-responsive - table.table.table-hover - tr - th Oracle Instance - th Status - - tr - td ORACLE OSF - td - - var status = osfstatus - if status == "OPEN" - span.label.label-success #{osfstatus} - else - span.label.label-danger #{osfstatus} - tr - td ORACLE SCO - td - - var myvar = scostatus - if status == "OPEN" - span.label.label-success #{scostatus} - else - span.label.label-danger #{scostatus} - section.col-lg-6.connectedSortable - // Box (with bar chart) - #loading-example.box.box-solid.box-info - .box-header - .pull-right.box-tools - button.btn.btn-info.btn-sm(data-widget='collapse',data-toggle='tooltip',title='Collapse') - i.fa.fa-minus - h3.box-title Server Load - .box-body - .row - .col-sm-12 - .pad - .clearfix - span.pull-left Oracle SCO Size - .row .col-md-6 .box.box-solid.box-info @@ -71,20 +22,105 @@ block content i.fa.fa-minus h3.box-title ASM Groups SCO - .box-body.table-responsive - table.table.table-bordered.table-hover - thead - tr - th Name - th Free (GB) - th Total (GB) - tbody - each metric, i in asmsco - td #{metric.name} - td #{metric.free} - td #{metric.total} - tr + .box-body + .clearfix + - var name = asmsco[0]["name"] + - var free = asmsco[0]["free"] + - var total = asmsco[0]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + .clearfix + - var name = asmsco[1]["name"] + - var free = asmsco[1]["free"] + - var total = asmsco[1]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmsco[2]["name"] + - var free = asmsco[2]["free"] + - var total = asmsco[2]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + + .clearfix + - var name = asmsco[3]["name"] + - var free = asmsco[3]["free"] + - var total = asmsco[3]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + .clearfix + - var name = asmsco[4]["name"] + - var free = asmsco[4]["free"] + - var total = asmsco[4]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + .clearfix + - var name = asmsco[5]["name"] + - var free = asmsco[5]["free"] + - var total = asmsco[5]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + .clearfix + - var name = asmsco[6]["name"] + - var free = asmsco[6]["free"] + - var total = asmsco[6]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + .clearfix + - var name = asmsco[7]["name"] + - var free = asmsco[7]["free"] + - var total = asmsco[7]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + .col-md-6 .box.box-solid.box-info .box-header @@ -93,19 +129,111 @@ block content i.fa.fa-minus h3.box-title ASM Groups OSF - .box-body.table-responsive - table.table.table-bordered.table-hover - thead - tr - th Name - th Free (GB) - th Total (GB) - tbody - each metric, i in asmosf - td #{metric.name} - td #{metric.free} - td #{metric.total} - tr + .box-body + + + .clearfix + - var name = asmosf[0]["name"] + - var free = asmosf[0]["free"] + - var total = asmosf[0]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[1]["name"] + - var free = asmosf[1]["free"] + - var total = asmosf[1]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[2]["name"] + - var free = asmosf[2]["free"] + - var total = asmosf[2]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[3]["name"] + - var free = asmosf[3]["free"] + - var total = asmosf[3]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[4]["name"] + - var free = asmosf[4]["free"] + - var total = asmosf[4]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[5]["name"] + - var free = asmosf[5]["free"] + - var total = asmosf[5]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + + .clearfix + - var name = asmosf[6]["name"] + - var free = asmosf[6]["free"] + - var total = asmosf[6]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + + .clearfix + - var name = asmosf[7]["name"] + - var free = asmosf[7]["free"] + - var total = asmosf[7]["total"] + - var used = (total - free).toFixed(2) + - var percentage = used/total*100 + span.pull-left #{name}, #{free} Free GB + small.pull-right #{used} / #{total} GB + .progress.xs + .progress-bar.progress-bar-aqua(style='width: #{percentage}%') + + .row .col-md-12 .box.box-solid.box-info diff --git a/web/views/topusers.jade b/web/views/topusers.jade index 47b78f0..052f392 100755 --- a/web/views/topusers.jade +++ b/web/views/topusers.jade @@ -1,4 +1,4 @@ -extends ../layout +extends layout block content // Content Header (Page header) section.content-header