Hi all,
I'm currently trying to get the UNIX agent for Observium working with some of our hosts so that we can obtain more data for applications, primarily NGINX.
We are now seeing data on the agent execution time graph.
We are getting responses from the Observium host to the NGINX host via Telnet, and receiving information about NGINX.
We are getting the NGINX status information through Lynx on the localhost.
We are using the following configs.
/etc/xinetd.d/observium_agent_xinetd service observium_agent { type = UNLISTED port = 36602 socket_type = stream protocol = tcp wait = no user = root server = /usr/bin/observium_agent
# configure the IPv[4|6] address(es) of your Observium server here: only_from = [IPs removed] 127.0.0.1 ::1
# Don't be too verbose. Don't log every check. This might be # commented out for debugging. If this option is commented out # the default options will be used for this service. log_on_success =
disable = no }
/usr/lib/observium_agent/local/nginx !/usr/bin/env python import urllib2 import re
data = urllib2.urlopen('http://localhost/nginx-status%27).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" ]
print "<<<nginx>>>\n";
for param in dataorder: if param == "Active": Active = int(params["Reading"]) + int(params["Writing"]) + int(params["Waiting"]) print Active else: print params[param]
/etc/nginx/sites-automatic/localhost.conf server { listen 80; listen [::]:80; server_name localhost; server_name_in_redirect off;
charset utf-8;
log_not_found on; access_log /var/log/nginx/localhost_combined-access.log combined buffer=128k flush=5m; error_log /var/log/nginx/localhost_error.log;
location / { root /local-storage/localhost/nginx-hosted/public_html; }
location /nginx-status { stub_status on; access_log off; allow 127.0.0.1; allow ::1; deny all; } }
Any help with this would be much appreciated.
Where can we expect to see logs? Any tips on how we can resolve this?
Regards, Alex.