Merge remote-tracking branch 'origin/develop' into ent-8620-copiando-a-grafana-3-grouped-meter-graphs-como-widget-en-dashboard

This commit is contained in:
Daniel Barbero 2022-10-10 09:00:35 +02:00
commit 836cef7830
26 changed files with 208 additions and 25 deletions

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.765-221006
Version: 7.0NG.765-221010
Architecture: all
Priority: optional
Section: admin

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.765-221006"
pandora_version="7.0NG.765-221010"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.765';
use constant AGENT_BUILD => '221006';
use constant AGENT_BUILD => '221010';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.765
%define release 221006
%define release 221010
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.765
%define release 221006
%define release 221010
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.765"
PI_BUILD="221006"
PI_BUILD="221010"
OS_NAME=`uname -s`
FORCE=0

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{221006}
{221010}
ViewReadme
{Yes}

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.765 Build 221006")
#define PANDORA_VERSION ("7.0NG.765 Build 221010")
string pandora_path;
string pandora_dir;

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.765(Build 221006))"
VALUE "ProductVersion", "(7.0NG.765(Build 221010))"
VALUE "FileVersion", "1.0.0.0"
END
END

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.765-221006
Version: 7.0NG.765-221010
Architecture: all
Priority: optional
Section: admin

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.765-221006"
pandora_version="7.0NG.765-221010"
package_pear=0
package_pandora=1

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC221006';
$build_version = 'PC221010';
$pandora_version = 'v7.0NG.765';
// Do not overwrite default timezone set if defined.

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.765';
$build = '221006';
$build = '221010';
$banner = "v$version Build $build";
error_reporting(0);

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.765
%define release 221006
%define release 221010
# User and Group under which Apache is running
%define httpd_name httpd

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.765
%define release 221006
%define release 221010
# User and Group under which Apache is running
%define httpd_name httpd

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.765
%define release 221006
%define release 221010
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

@ -0,0 +1,183 @@
#!/bin/bash
function help {
echo -e "Synology Plugin for Pandora FMS Plugin server. http://pandorafms.com"
echo " "
echo "This plugin is used to monitor a Synology device via SNMP checks"
echo -e "Syntax:"
echo -e "\t\tparameter 1 must be the IP address of the device"
echo -e "\t\tparameter 2 must be the SNMP Community (only v2c)"
echo -e "\t\tparameter 3 must be the Pandora FMS agent name"
echo -e "Sample:"
echo " ./synology.sh 10.113.7.220 frcpass PPAMSSV020"
echo ""
exit
}
if [ $# -ne 3 ]
then
help
fi
ip=$1
community=$2
agent=$3
temp="/tmp"
filename="synology$agent.123456.data"
file="$temp/$filename"
pandoradir="/var/spool/pandora/data_in/"
snmp=$(snmpwalk -v2c -c"$community" "$ip" 1.3.6.1.4.1.6574.1 2>&1)
if [[ "$snmp" == *"Timeout"* ]]
then
echo "0"
exit 0
else
echo "1"
fi
echo "<?xml version='1.0' encoding='UTF-8'?><agent_data agent_name='$agent' interval='300'>" > $file
systemstatus=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.1.0)
systemtemp=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.2.0)
systempower=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.3.0)
systemfan=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.4.1.0)
cpufan=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.4.2.0)
model=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.5.1.0)
version=$(snmpwalk -v2c -c"$community" "$ip" -Ovq .1.3.6.1.4.1.6574.1.5.3.0)
echo "<module>" >> $file
echo "<name><![CDATA[System Status]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$systemstatus]]></data>" >> $file
echo "<description><![CDATA[Synology system status Each meanings of status represented describe below. Normal(1): System functionals normally. Failed(2): Volume has crashed.]]></description>" >> $file
echo "<min_warning><![CDATA[0]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[2]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[System Temperature]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$systemtemp]]></data>" >> $file
echo "<description><![CDATA[Synology system temperature The temperature of Disk Station uses Celsius degree.]]></description>" >> $file
echo "<unit><![CDATA[Cº]]></unit>" >> $file
echo "<min_warning><![CDATA[50]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[60]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[System Power]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$systempower]]></data>" >> $file
echo "<description><![CDATA[Synology power status Each meanings of status represented describe below. Normal(1): All power supplies functional normally. Failed(2): One of power supply has failed.]]></description>" >> $file
echo "<min_warning><![CDATA[0]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[2]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[System Fan Status]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$systemfan]]></data>" >> $file
echo "<description><![CDATA[Synology system fan status Each meanings of status represented describe below. Normal(1): All Internal fans functional normally. Failed(2): One of internal fan stopped.]]></description>" >> $file
echo "<min_warning><![CDATA[0]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[2]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[CPU Fan Status]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$cpufan]]></data>" >> $file
echo "<description><![CDATA[Synology cpu fan status Each meanings of status represented describe below. Normal(1): All CPU fans functional normally. Failed(2): One of CPU fan stopped.]]></description>" >> $file
echo "<min_warning><![CDATA[0]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[2]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[Model name]]></name>" >> $file
echo "<type>generic_data_string</type>" >> $file
echo "<data><![CDATA[$model]]></data>" >> $file
echo "<description><![CDATA[The Model name of this NAS]]></description>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[OS version]]></name>" >> $file
echo "<type>generic_data_string</type>" >> $file
echo "<data><![CDATA[$version]]></data>" >> $file
echo "<description><![CDATA[The version of this DSM]]></description>" >> $file
echo "</module>" >> $file
for i in $(snmpwalk -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.2.1.1.1)
do
disk_id=$(snmpget -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.2.1.1.2.$i | sed 's/"//g')
disk_name=$(snmpget -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.2.1.1.3.$i| sed 's/"//g')
disk_status=$(snmpget -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.2.1.1.5.$i)
disk_temp=$(snmpget -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.2.1.1.6.$i)
echo "<module>" >> $file
echo "<name><![CDATA[Disk "$disk_id"-"$disk_name" Status]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$disk_status]]></data>" >> $file
echo "<description><![CDATA[Synology disk status Each meanings of status represented describe below. Normal(1): The hard disk functions normally. Initialized(2): The hard disk has system partition but no data. NotInitialized(3): The hard disk does not have system in system partition. SystemPartitionFailed(4): The system partitions on the hard disks are damaged. Crashed(5): The hard disk has damaged.]]></description>" >> $file
echo "<min_warning><![CDATA[2]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[3]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[Disk "$disk_id"-"$disk_name" Temperature]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$disk_temp]]></data>" >> $file
echo "<description><![CDATA[Synology disk temperature The temperature of each disk uses Celsius degree. ]]></description>" >> $file
echo "<unit><![CDATA[Cº]]></unit>" >> $file
echo "<min_warning><![CDATA[50]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[60]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
done
for i in $(snmpwalk -v2c -c"$community" "$ip" -Ovq SNMPv2-SMI::enterprises.6574.3.1.1.1)
do
raid_name=$(snmpget -v2c -c"$community" "$ip" -Ovq 1.3.6.1.4.1.6574.3.1.1.2.$i| sed 's/"//g')
raid_status=$(snmpget -v2c -c"$community" "$ip" -Ovq 1.3.6.1.4.1.6574.3.1.1.3.$i)
raid_free=$(snmpget -v2c -c"$community" "$ip" -Ovq 1.3.6.1.4.1.6574.3.1.1.4.$i)
raid_total=$(snmpget -v2c -c"$community" "$ip" -Ovq 1.3.6.1.4.1.6574.3.1.1.5.$i)
perc_total=$(echo "scale=2; $raid_free * 100 / $raid_total" | bc)
echo "<module>" >> $file
echo "<name><![CDATA[RAID $raid_name Status]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$raid_status]]></data>" >> $file
echo "<description><![CDATA[It shows the RAID status right now]]></description>" >> $file
echo "<min_warning><![CDATA[2]]></min_warning>" >> $file
echo "<max_warning><![CDATA[0]]></max_warning>" >> $file
echo "<min_critical><![CDATA[11]]></min_critical>" >> $file
echo "<max_critical><![CDATA[0]]></max_critical>" >> $file
echo "</module>" >> $file
echo "<module>" >> $file
echo "<name><![CDATA[RAID $raid_name Free]]></name>" >> $file
echo "<type>generic_data</type>" >> $file
echo "<data><![CDATA[$perc_total]]></data>" >> $file
echo "<description><![CDATA[Percentage of free space on RAID]]></description>" >> $file
echo "<unit><![CDATA[%]]></unit>" >> $file
echo "<min_warning><![CDATA[0]]></min_warning>" >> $file
echo "<max_warning><![CDATA[10]]></max_warning>" >> $file
echo "<min_critical><![CDATA[0]]></min_critical>" >> $file
echo "<max_critical><![CDATA[5]]></max_critical>" >> $file
echo "</module>" >> $file
done
echo "</agent_data>" >> $file
mv $file $pandoradir

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.765-221006
Version: 7.0NG.765-221010
Architecture: all
Priority: optional
Section: admin

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.765-221006"
pandora_version="7.0NG.765-221010"
package_cpan=0
package_pandora=1

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.765";
my $pandora_build = "221006";
my $pandora_build = "221010";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.765";
my $pandora_build = "221006";
my $pandora_build = "221010";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.765
%define release 221006
%define release 221010
Summary: Pandora FMS Server
Name: %{name}

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.765
%define release 221006
%define release 221010
Summary: Pandora FMS Server
Name: %{name}

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.765"
PI_BUILD="221006"
PI_BUILD="221010"
MODE=$1
if [ $# -gt 1 ]; then

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.765 Build 221006";
my $version = "7.0NG.765 Build 221010";
# Pandora server configuration
my %conf;

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.765 Build 221006";
my $version = "7.0NG.765 Build 221010";
# save program name for logging
my $progname = basename($0);