Skip to content

Commit

Permalink
trying gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
scardena committed Mar 10, 2016
1 parent 69dd373 commit d8a96fd
Show file tree
Hide file tree
Showing 11 changed files with 363 additions and 740 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# APO-Dashboard

<img src="pic_mountain.jpg" alt="Mountain View" style="width:304px;height:228px;">

Source Code for APO Dashboards
8 changes: 6 additions & 2 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down Expand Up @@ -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
Expand Down
43 changes: 28 additions & 15 deletions web/routes/index.js
Original file line number Diff line number Diff line change
@@ -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. */
Expand Down Expand Up @@ -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);}

///////////////////////////////////////////////
Expand Down Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion web/routes/oracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit d8a96fd

Please sign in to comment.