aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM.Gergő2020-05-25 15:44:42 +0200
committerM.Gergő2020-05-25 15:44:42 +0200
commit3e8e87c262421510f1e1911341710814fe5481c9 (patch)
tree34862322400677b9437a521984a259320fbb5f68
parentfa789ee1793c0f98761705b66cc9c0ae5318c52b (diff)
downloadmunin-unifi-3e8e87c262421510f1e1911341710814fe5481c9.tar.gz
munin-unifi-3e8e87c262421510f1e1911341710814fe5481c9.zip
More debugv2.1.0
-rw-r--r--README.md6
-rwxr-xr-xtest.sh18
-rw-r--r--ubnt_unifi.php6
3 files changed, 25 insertions, 5 deletions
diff --git a/README.md b/README.md
index 565441f..330a054 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
### This is a [Munin](http://munin-monitoring.org/) plugin to monitor your [Ubiquiti Unifi](https://www.ubnt.com/products/#unifi) wireless AP status.
-* It queries the AP's via SNMPv2 and converts result for munin.
+* It queries the APs via SNMPv2 and converts result for munin.
* Requires:
- * Enabled SNMP on AP's.
- * Network access from munin-server to AP's network.
+ * Enabled SNMP on Access Points.
+ * Network access from munin-node server to AP's network.
* PHP 7.0 or above
* PHP SNMP module
* PHP JSON module
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..db70c2c
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+controller="aaa.bbb.com"
+timeout="800"
+retry="1"
+maxproc="24"
+devnet="192.168.1.0/32"
+devices="ap1.local ap1.local 192.168.1.1 192.168.1.111"
+
+export controller
+export timeout
+export retry
+export maxproc
+export devnet
+export devices
+
+php ubnt_unifi.php debug
+
diff --git a/ubnt_unifi.php b/ubnt_unifi.php
index 2b7f4bd..4b06d35 100644
--- a/ubnt_unifi.php
+++ b/ubnt_unifi.php
@@ -577,7 +577,7 @@ $hosts = $hostsr;
//$test = collect_response_time($raw, "ap12.wireless.lan");
//print_r($test);
-if(!is_array($raw) /*|| empty($raw)*/ ){
+if(!is_array($raw) /*|| empty($raw)*/ /* */){
die();
}
@@ -621,7 +621,9 @@ if (isset($argv[1]) and $argv[1] == "config"){ // munin config
echo "\tFunction_exist(pcntl_fork): ".function_exists("pcntl_fork")."\n";
echo "\tFunction_exist(pcntl_waitpid): ".function_exists("pcntl_waitpid")."\n";
echo "\tFunction_exist(json_encode): ".function_exists("json_encode")."\n";
- echo "\nRAW\n";
+ echo "\tFunction_exist(snmp2_get): ".function_exists("snmp2_get")."\n";
+
+ echo "\n\nRAW_data: \n";
print_r($raw);
echo "\nCollected infos on Controller:\n";