Fix invalid json in test data (#9015)

* Fix invalid json in test data
Most simply needed the syntax fixed
fail2ban needed updated data (added non-zero values in test data too)
awplus: ntp application cannot be enabled by tests since it doesn't use snmp extend... ntp app is enabled by ntp module... pass on that for now.

* missed awplus change somehow...
This commit is contained in:
Tony Murray
2018-08-16 11:11:03 -05:00
committed by GitHub
parent 731da950d9
commit 184f5a5f99
12 changed files with 29 additions and 39 deletions
+5
View File
@@ -238,6 +238,11 @@ class ModuleTestHelper
// calculate valid modules
$data_modules = array_keys(json_decode(file_get_contents($file), true));
if (json_last_error()) {
echo "Invalid json data: $base_name\n";
exit(1);
}
if (empty($modules)) {
$valid_modules = $data_modules;
} else {
@@ -43,11 +43,9 @@ $rrd_def = RrdDefinition::make()
->addDataset('firewalled', 'GAUGE', 0);
$fields = array(
'banned' => $f2b['total'],
'firewalled'=>'U', // legacy ds
);
$metrics['total'] = $fields;
$fields = ['banned' => $f2b['total']];
$metrics['total'] = $fields; // don't include legacy ds in db
$fields['firewalled'] = 'U'; // legacy ds
$tags = array('name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name);
data_update($device, 'app', $tags, $fields);
+1 -1
View File
@@ -2888,7 +2888,7 @@
"processors": []
},
"poller": "matches discovery"
}
},
"storage": {
"discovery": {
"storage": [
-13
View File
@@ -12442,19 +12442,6 @@
]
}
},
"applications": {
"poller": {
"applications": [
{
"app_type": "ntp",
"app_state": "UNKNOWN",
"discovered": "0",
"app_state_prev": null,
"app_status": "",
"app_instance": ""
}
],
"application_metrics": []
"vlans": {
"discovery": {
"vlans": [
+1 -1
View File
@@ -466,5 +466,5 @@
}
]
}
},
}
}
+1 -1
View File
@@ -437,5 +437,5 @@
"state_indexes": []
},
"poller": "matches discovery"
},
}
}
+1 -1
View File
@@ -437,5 +437,5 @@
}
]
}
},
}
}
+7 -7
View File
@@ -26,23 +26,23 @@
],
"application_metrics": [
{
"metric": "jail_dovecot",
"value": "0",
"metric": "jail_dovecot_banned",
"value": "6",
"value_prev": null,
"app_type": "fail2ban"
},
{
"metric": "jail_sshd",
"value": "0",
"metric": "jail_sshd_banned",
"value": "4",
"value_prev": null,
"app_type": "fail2ban"
},
{
"metric": "total",
"value": "0",
"metric": "total_banned",
"value": "10",
"value_prev": null,
"app_type": "fail2ban"
},
}
]
}
}
+7 -7
View File
@@ -26,23 +26,23 @@
],
"application_metrics": [
{
"metric": "jail_dovecot",
"value": "0",
"metric": "jail_dovecot_banned",
"value": "5",
"value_prev": null,
"app_type": "fail2ban"
},
{
"metric": "jail_sshd",
"value": "0",
"metric": "jail_sshd_banned",
"value": "3",
"value_prev": null,
"app_type": "fail2ban"
},
{
"metric": "total",
"value": "0",
"metric": "total_banned",
"value": "8",
"value_prev": null,
"app_type": "fail2ban"
},
}
]
}
}
+1 -1
View File
@@ -91,7 +91,7 @@
"ifOutUcastPkts_prev": null,
"ifOutUcastPkts_delta": null,
"ifOutUcastPkts_rate": null,
"ifInErrors": null,extreme
"ifInErrors": null,
"ifInErrors_prev": null,
"ifInErrors_delta": null,
"ifInErrors_rate": null,
+1 -1
View File
@@ -7,5 +7,5 @@
1.3.6.1.2.1.25.1.1.0|67|77552962
1.3.6.1.4.1.8072.1.3.2.2.1.21.6.100.105.115.116.114.111|2|1
1.3.6.1.4.1.8072.1.3.2.2.1.21.8.102.97.105.108.50.98.97.110|2|1
1.3.6.1.4.1.8072.1.3.2.3.1.2.8.102.97.105.108.50.98.97.110|4x|300a646f7665636f7420300a7373686420300a
1.3.6.1.4.1.8072.1.3.2.3.1.2.8.102.97.105.108.50.98.97.110|4x|31300a646f7665636f7420360a7373686420340a
1.3.6.1.6.3.10.2.1.3.0|2|775505
+1 -1
View File
@@ -7,5 +7,5 @@
1.3.6.1.2.1.25.1.1.0|67|77552962
1.3.6.1.4.1.8072.1.3.2.2.1.21.6.100.105.115.116.114.111|2|1
1.3.6.1.4.1.8072.1.3.2.2.1.21.8.102.97.105.108.50.98.97.110|2|1
1.3.6.1.4.1.8072.1.3.2.3.1.2.8.102.97.105.108.50.98.97.110|4x|7b2264617461223a7b226a61696c73223a7b2273736864223a2230222c22646f7665636f74223a2230227d2c22746f74616c223a307d2c226572726f72223a2230222c2276657273696f6e223a312c226572726f72537472696e67223a226661696c3262616e2d636c69656e742065786974656420776974682030227d0a
1.3.6.1.4.1.8072.1.3.2.3.1.2.8.102.97.105.108.50.98.97.110|4x|7b2264617461223a7b226a61696c73223a7b2273736864223a2233222c22646f7665636f74223a2235227d2c22746f74616c223a387d2c226572726f72223a2230222c2276657273696f6e223a312c226572726f72537472696e67223a226661696c3262616e2d636c69656e742065786974656420776974682030227d0a
1.3.6.1.6.3.10.2.1.3.0|2|775505