Merge branch '1730-missed-enterprise-plugins' into 'develop'
Fixed some default values in PluginTools See merge request artica/pandorafms!1239
This commit is contained in:
commit
2af1b628a8
|
@ -64,6 +64,7 @@ $PANDHOME_ENT/pandora_plugins/Nutanix/pandora_nutanix.pl \
|
||||||
$PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \
|
$PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \
|
||||||
$PANDHOME_ENT/pandora_plugins/Informix/informix.pl \
|
$PANDHOME_ENT/pandora_plugins/Informix/informix.pl \
|
||||||
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \
|
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \
|
||||||
|
$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \
|
||||||
$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl "
|
$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl "
|
||||||
PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm"
|
PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]
|
||||||
|
then
|
||||||
|
echo
|
||||||
|
echo "Usage: domain_expiration_date.sh <domain_name>"
|
||||||
|
echo "Returns the number of days to expiration date"
|
||||||
|
echo
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
domain=$1
|
||||||
|
|
||||||
|
# Calculate days until expiration
|
||||||
|
expiration=`whois $domain |grep "Expiry Date:"| awk -F"Date:" '{print $2}'|cut -f 1`
|
||||||
|
expseconds=`date +%s --date="$expiration"`
|
||||||
|
nowseconds=`date +%s`
|
||||||
|
((diffseconds=expseconds-nowseconds))
|
||||||
|
expdays=$((diffseconds/86400))
|
||||||
|
|
||||||
|
echo $expdays
|
||||||
|
|
|
@ -10,12 +10,6 @@ package PandoraFMS::PluginTools;
|
||||||
# ------- --------------
|
# ------- --------------
|
||||||
# LWP::UserAgent perl-libwww-perl
|
# LWP::UserAgent perl-libwww-perl
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#
|
|
||||||
# Version Date
|
|
||||||
# a1 17-11-2015
|
|
||||||
# ** Revision handler in gitlab **
|
|
||||||
#
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
@ -58,6 +52,7 @@ our @EXPORT = qw(
|
||||||
get_unit
|
get_unit
|
||||||
get_unix_time
|
get_unix_time
|
||||||
get_sys_environment
|
get_sys_environment
|
||||||
|
get_current_utime_milis
|
||||||
getCurrentUTimeMilis
|
getCurrentUTimeMilis
|
||||||
head
|
head
|
||||||
in_array
|
in_array
|
||||||
|
@ -100,6 +95,7 @@ sub get_lib_version {
|
||||||
################################################################################
|
################################################################################
|
||||||
# Get current time (milis)
|
# Get current time (milis)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
sub get_current_utime_milis { return getCurrentUTimeMilis(); }
|
||||||
sub getCurrentUTimeMilis {
|
sub getCurrentUTimeMilis {
|
||||||
#return trim (`date +"%s%3N"`); # returns 1449681679712
|
#return trim (`date +"%s%3N"`); # returns 1449681679712
|
||||||
return floor(time*1000);
|
return floor(time*1000);
|
||||||
|
@ -609,7 +605,11 @@ sub transfer_xml {
|
||||||
|
|
||||||
close (FD);
|
close (FD);
|
||||||
|
|
||||||
|
# Reassign default values if not present
|
||||||
|
$conf->{tentacle_client} = "tentacle_client" if empty($conf->{tentacle_client});
|
||||||
|
$conf->{tentacle_port} = "44121" if empty($conf->{tentacle_port});
|
||||||
$conf->{mode} = $conf->{transfer_mode} if empty($conf->{mode});
|
$conf->{mode} = $conf->{transfer_mode} if empty($conf->{mode});
|
||||||
|
|
||||||
if (empty ($conf->{mode}) ) {
|
if (empty ($conf->{mode}) ) {
|
||||||
print_stderror($conf, "[ERROR] Nor \"mode\" nor \"transfer_mode\" defined in configuration.");
|
print_stderror($conf, "[ERROR] Nor \"mode\" nor \"transfer_mode\" defined in configuration.");
|
||||||
return undef;
|
return undef;
|
||||||
|
|
|
@ -248,9 +248,11 @@ if ($module eq "process") {
|
||||||
$command_line_parammeters = "-v $version -c $community $host";
|
$command_line_parammeters = "-v $version -c $community $host";
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = `snmpwalk $command_line_parammeters 1.3.6.1.2.1.25.4.2.1.2 | grep "$process" | head -1 | wc -l`;
|
$status = `snmpwalk $command_line_parammeters 1.3.6.1.2.1.25.4.2.1.2 2>/dev/null`;
|
||||||
|
|
||||||
print $status;
|
if ($? == 0) {
|
||||||
|
print (($status =~ m/$process/mi)?1:0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue