summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authornertwork <webmaster@nertwork.com>2016-12-20 10:49:24 -0800
committernertwork <webmaster@nertwork.com>2016-12-20 10:49:24 -0800
commite0621bbb81daab0de9fccc031c3e875031c2b67b (patch)
tree9b527895c0a07d216f67728526b0ed7f82a40d12 /extra
parentbcdd40d552cbf5e32dafebf4e531d407eb85bc84 (diff)
parent1466f0f635d1e014ea993179729306d3a9a8d381 (diff)
Merge remote-tracking branch 'upstream/master'
* upstream/master: (109 commits) delete secret password if it is called secret bump up version update changelogs Recursively search from one dir above specified Fix suggested by ytti for issue #610 Remove trailing whitespace and enable prompt detection Update eos.rb exclude time from output New hook: awssns - Publish messages to AWS SNS topics Updated config options Added option to disable ssl verification checks for http source Update ciscosmb.rb Update ciscosmb.rb Update ciscosmb.rb expect prompt after entering enable password add support for PLANET SG switches renamed alvarion -> alvarion.rb This adds support for Hatteras Networks devices This adds support for D-Link switches This adds support for the Casa C1G CMTS ...
Diffstat (limited to 'extra')
-rw-r--r--extra/oxidized.apache214
-rw-r--r--extra/oxidized.nginx14
-rw-r--r--extra/rest_client.rb28
3 files changed, 53 insertions, 3 deletions
diff --git a/extra/oxidized.apache2 b/extra/oxidized.apache2
new file mode 100644
index 0000000..0ab372b
--- /dev/null
+++ b/extra/oxidized.apache2
@@ -0,0 +1,14 @@
+<VirtualHost *:80>
+ # Place in sites-available
+
+ ServerAdmin admin@example.com
+ ServerName oxidized.example.com
+ ServerAlias oxidized
+
+ ProxyPass / http://127.0.0.1:8888/
+ ProxyPassReverse / http://127.0.0.1:8888/
+
+ ErrorLog /var/log/apache2/oxidized_error.log
+ CustomLog /var/log/apache2/oxidized_access.log combined
+
+</VirtualHost>
diff --git a/extra/oxidized.nginx b/extra/oxidized.nginx
new file mode 100644
index 0000000..06a4768
--- /dev/null
+++ b/extra/oxidized.nginx
@@ -0,0 +1,14 @@
+server {
+ listen 80;
+ listen [::]:80;
+
+ server_name oxidized.example.com;
+
+ location / {
+ proxy_pass http://127.0.0.1:8888/;
+ }
+
+ access_log /var/log/nginx/access_oxidized.log;
+ error_log /var/log/nginx/error_oxidized.log;
+}
+
diff --git a/extra/rest_client.rb b/extra/rest_client.rb
index a16bd42..35d93ae 100644
--- a/extra/rest_client.rb
+++ b/extra/rest_client.rb
@@ -2,8 +2,30 @@ module Oxidized
class RestClient
require 'net/http'
require 'json'
- HOST = 'localhost'
- PORT = 8888
+ require 'uri'
+ require 'asetus'
+
+ class Config
+ Root = Root = ENV['OXIDIZED_HOME'] || File.join(ENV['HOME'], '.config', 'oxidized')
+ end
+
+ CFGS = Asetus.new :name=>'oxidized', :load=>false, :key_to_s=>true
+ CFGS.default.rest = '127.0.0.1:8888'
+
+ begin
+ CFGS.load
+ rescue => error
+ raise InvalidConfig, "Error loading config: #{error.message}"
+ end
+
+ restcfg = CFGS.cfg.rest
+ unless restcfg.match(/^http:\/\//)
+ restcfg.insert(0, 'http://')
+ end
+
+ HOST = URI(restcfg).host
+ PORT = URI(restcfg).port
+ PATH = URI(restcfg).path
class << self
def next opt={}, host=HOST, port=PORT
@@ -18,7 +40,7 @@ module Oxidized
def next opt
data = JSON.dump opt
- @web.put '/node/next/' + opt[:name].to_s, data
+ @web.put PATH + '/node/next/' + opt[:name].to_s, data
end
end