mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Apply fixes from StyleCI (#12120)
This commit is contained in:
		@@ -1,2 +1,3 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_dhcp " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,9 @@
 | 
			
		||||
 | 
			
		||||
// provide some sane default
 | 
			
		||||
if ($service['service_param']) {
 | 
			
		||||
    $nsquery  = $service['service_param'];
 | 
			
		||||
    $nsquery = $service['service_param'];
 | 
			
		||||
} else {
 | 
			
		||||
    $nsquery  = "localhost";
 | 
			
		||||
    $nsquery = "localhost";
 | 
			
		||||
}
 | 
			
		||||
if ($service['service_ip']) {
 | 
			
		||||
    $resolver = $service['service_ip'];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
#Get check_domain from https://raw.githubusercontent.com/glensc/nagios-plugin-check_domain/master/check_domain.sh
 | 
			
		||||
//Get check_domain from https://raw.githubusercontent.com/glensc/nagios-plugin-check_domain/master/check_domain.sh
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_domain -d ";
 | 
			
		||||
if ($service['service_ip']) {
 | 
			
		||||
    $check_cmd .= $service['service_ip'];
 | 
			
		||||
} else {
 | 
			
		||||
    $check_cmd .= $service['hostname'];
 | 
			
		||||
}
 | 
			
		||||
$check_cmd .= " ".$service['service_param'];
 | 
			
		||||
$check_cmd .= " " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// For use with Graylog2 plugin by Catinello found at https://marketplace.graylog.org/addons/9ee98819-804e-41c3-b0ac-6ca7975c1a48
 | 
			
		||||
// example parameters: -l https://graylog1.example.com:9000/api -insecure -p password -u username -w 10 -c 20
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_graylog " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,2 +1,3 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_haproxy " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// check_cmd is the command that is run to execute the check
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_icmp " . ($service['service_ip'] ? $service['service_ip'] : $service['hostname']) . " " . $service['service_param'];
 | 
			
		||||
 | 
			
		||||
@@ -6,7 +7,7 @@ $check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_icmp " . ($servic
 | 
			
		||||
$check_ds = '{"rtt":"s","pl":"%"}';
 | 
			
		||||
 | 
			
		||||
// Build the graph data
 | 
			
		||||
$check_graph = array();
 | 
			
		||||
$check_graph = [];
 | 
			
		||||
$check_graph['rtt'] = " DEF:DS0=" . $rrd_filename . ":rta:AVERAGE ";
 | 
			
		||||
$check_graph['rtt'] .= " LINE1.25:DS0#" . \LibreNMS\Config::get('graph_colours.mixed.0') . ":'" . str_pad(substr("Round Trip Average", 0, 15), 15) . "' ";
 | 
			
		||||
$check_graph['rtt'] .= " GPRINT:DS0:LAST:%5.2lf%s ";
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,9 @@
 | 
			
		||||
 | 
			
		||||
// provide some sane default
 | 
			
		||||
if ($service['service_param']) {
 | 
			
		||||
    $params  = $service['service_param'];
 | 
			
		||||
    $params = $service['service_param'];
 | 
			
		||||
} else {
 | 
			
		||||
    $params  = "-w 5,5,5 -c 10,10,10";
 | 
			
		||||
    $params = "-w 5,5,5 -c 10,10,10";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_load " . $params;
 | 
			
		||||
@@ -13,7 +13,7 @@ $check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_load " . $params;
 | 
			
		||||
$check_ds = '{"load":""}';
 | 
			
		||||
 | 
			
		||||
// Build the graph data
 | 
			
		||||
$check_graph = array();
 | 
			
		||||
$check_graph = [];
 | 
			
		||||
$check_graph['load'] = " DEF:DS0=" . $rrd_filename . ":load1:AVERAGE ";
 | 
			
		||||
$check_graph['load'] .= " LINE1.25:DS0#" . \LibreNMS\Config::get('graph_colours.mixed.0') . ":'" . str_pad(substr("Load 1", 0, 15), 15) . "' ";
 | 
			
		||||
$check_graph['load'] .= " GPRINT:DS0:LAST:%5.2lf%s ";
 | 
			
		||||
 
 | 
			
		||||
@@ -7,4 +7,4 @@ if ($service['service_ip']) {
 | 
			
		||||
} else {
 | 
			
		||||
    $check_cmd .= $service['server'];
 | 
			
		||||
}
 | 
			
		||||
$check_cmd .= " ".$service['service_param'];
 | 
			
		||||
$check_cmd .= " " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ $check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_mysql -H " . $ser
 | 
			
		||||
$check_ds = '{"mysqlqueries":"c","mysql":"c","mysqluptime":"c","mysqlQcache":"c"}';
 | 
			
		||||
 | 
			
		||||
// Build the graph data
 | 
			
		||||
$check_graph = array();
 | 
			
		||||
$check_graph = [];
 | 
			
		||||
$mixed_colours = \LibreNMS\Config::get('graph_colours.mixed');
 | 
			
		||||
 | 
			
		||||
$check_graph['mysqlqueries'] = " DEF:DS0=" . $rrd_filename . ":Queries:AVERAGE ";
 | 
			
		||||
@@ -26,7 +26,6 @@ $check_graph['mysqlqueries'] .= " GPRINT:DS1:LAST:%0.0lf ";
 | 
			
		||||
$check_graph['mysqlqueries'] .= " GPRINT:DS1:AVERAGE:%0.0lf ";
 | 
			
		||||
$check_graph['mysqlqueries'] .= " GPRINT:DS1:MAX:%0.0lf\\l ";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$check_graph['mysql'] = " DEF:DS0=" . $rrd_filename . ":Connections:AVERAGE ";
 | 
			
		||||
$check_graph['mysql'] .= " LINE1.25:DS0#" . $mixed_colours[0] . ":'" . str_pad(substr("Connections", 0, 19), 19) . "' ";
 | 
			
		||||
$check_graph['mysql'] .= " GPRINT:DS0:LAST:%5.2lf%s ";
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,13 @@
 | 
			
		||||
<?php
 | 
			
		||||
/**
 | 
			
		||||
* check_oracle Nagios Plugin
 | 
			
		||||
* Docs: https://www.monitoring-plugins.org/doc/man/check_oracle.html
 | 
			
		||||
*
 | 
			
		||||
* If the plugin doesn't work, check that the ORACLE_HOME environment
 | 
			
		||||
* variable is set, that ORACLE_HOME/bin is in your PATH, and the
 | 
			
		||||
* tnsnames.ora file is locatable and is properly configured.
 | 
			
		||||
*
 | 
			
		||||
* This plugin does not accept the '-H' flag for hostname/IP address
 | 
			
		||||
* that most other Nagios plugins do.
 | 
			
		||||
*
 | 
			
		||||
*/
 | 
			
		||||
 * check_oracle Nagios Plugin
 | 
			
		||||
 * Docs: https://www.monitoring-plugins.org/doc/man/check_oracle.html
 | 
			
		||||
 *
 | 
			
		||||
 * If the plugin doesn't work, check that the ORACLE_HOME environment
 | 
			
		||||
 * variable is set, that ORACLE_HOME/bin is in your PATH, and the
 | 
			
		||||
 * tnsnames.ora file is locatable and is properly configured.
 | 
			
		||||
 *
 | 
			
		||||
 * This plugin does not accept the '-H' flag for hostname/IP address
 | 
			
		||||
 * that most other Nagios plugins do.
 | 
			
		||||
 */
 | 
			
		||||
$check_cmd = \LibreNMS\Config::get('nagios_plugins') . "/check_oracle " . $service['service_param'];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
if ($service['service_port']) {
 | 
			
		||||
    $port = $service['service_port'];
 | 
			
		||||
} else {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user