diff --git a/html/images/icons/greyscale/nginx.png b/html/images/icons/greyscale/nginx.png new file mode 100644 index 0000000000..5bc3e69293 Binary files /dev/null and b/html/images/icons/greyscale/nginx.png differ diff --git a/html/images/icons/nginx.png b/html/images/icons/nginx.png new file mode 100644 index 0000000000..9e228a4ab8 Binary files /dev/null and b/html/images/icons/nginx.png differ diff --git a/html/includes/graphs/application/nginx_connections.inc.php b/html/includes/graphs/application/nginx_connections.inc.php new file mode 100644 index 0000000000..9d1f3da23f --- /dev/null +++ b/html/includes/graphs/application/nginx_connections.inc.php @@ -0,0 +1,38 @@ + diff --git a/html/includes/graphs/application/nginx_req.inc.php b/html/includes/graphs/application/nginx_req.inc.php new file mode 100644 index 0000000000..7feda4c0c8 --- /dev/null +++ b/html/includes/graphs/application/nginx_req.inc.php @@ -0,0 +1,22 @@ + diff --git a/html/pages/device/apps/nginx.inc.php b/html/pages/device/apps/nginx.inc.php new file mode 100644 index 0000000000..f8edacc584 --- /dev/null +++ b/html/pages/device/apps/nginx.inc.php @@ -0,0 +1,27 @@ + 'nginx Connections', + 'nginx_req' => 'nginx requests'); + +foreach($graphs as $key => $text) { + $graph_type = $key; + $graph_array['height'] = "100"; + $graph_array['width'] = "215"; + $graph_array['to'] = $now; + $graph_array['id'] = $app['app_id']; + $graph_array['type'] = "application_".$key; + echo('

'.$text.'

'); + + echo(""); + + + + include("includes/print-quadgraphs.inc.php"); + echo(""); + +} + + + +?> diff --git a/includes/polling/applications/nginx.inc.php b/includes/polling/applications/nginx.inc.php new file mode 100644 index 0000000000..0bba79c2cd --- /dev/null +++ b/includes/polling/applications/nginx.inc.php @@ -0,0 +1,37 @@ + diff --git a/scripts/nginx-stats b/scripts/nginx-stats new file mode 100644 index 0000000000..11a19cf3ca --- /dev/null +++ b/scripts/nginx-stats @@ -0,0 +1,37 @@ +#!/usr/bin/env python +import urllib2 +import re + + +data = urllib2.urlopen('http://localhost/nginx-status').read() + +params = {} + +for line in data.split("\n"): + smallstat = re.match(r"\s?Reading:\s(.*)\sWriting:\s(.*)\sWaiting:\s(.*)$", line) + req = re.match(r"\s+(\d+)\s+(\d+)\s+(\d+)", line) + if smallstat: + params["Reading"] = smallstat.group(1) + params["Writing"] = smallstat.group(2) + params["Waiting"] = smallstat.group(3) + elif req: + params["Requests"] = req.group(3) + else: + pass + + +dataorder = [ + "Active", + "Reading", + "Writing", + "Waiting", + "Requests" + ] + + +for param in dataorder: + if param == "Active": + Active = int(params["Reading"]) + int(params["Writing"]) + int(params["Waiting"]) + print Active + else: + print params[param]