Pandora FMS Community

Error from plugin on server since the upgrade to Pandora 5.1 SP1

Chuck · 11 dic 2014, 1:30 · 8 mensajes · 63 visitas

  1. Inicio del debate

    I am getting the following error from the server log for two plug-ins that worked fine until my upgrade to 5.1 SP1. [ERROR] Undefined value returned by plug-in module X agent Y. Is the server out of memory? I have confirmed permissions for the folder and files for apache, checked for timeouts,  and tested that the scripts run from terminal and return one value.  Any other ideas? Both plugins are Perl scripts and the code for one of the scripts is below. It is a simple script that combines in and out octets for total network usage. And again, it works from the terminal command line.

    #!/usr/bin/perl -w
    
    use strict;
    use warnings;
    
    sub get_param($) {
            my $param = shift;
            my $value = undef;
    
            $param = "-".$param;
    
            for(my $i=0; $i<$#ARGV; $i++) {
    
                    if ($ARGV[$i] eq $param) {
                            $value = $ARGV[$i+1];
                            last;
                    }
    
            }
            return $value;
    }
    
    sub usage () {
            print "iface_bandwith.pl version v1r1n";
            print "nusage: $0 -ip  -com  -if n";
            print "nIMPORTANT: This plugin uses SNMP v1nn";
    }
    
    #Global variables
    my $ip = get_param("ip");
    my $community = get_param("com");
    my $ifname = get_param("if");
    
    if (!defined($ip) ||
            !defined($community) ||
            !defined($ifname) ) {
            usage();
            exit;
    }
    
    #Browse interface name
    my $res = `snmpwalk -L n -c $community -v1 $ip .1.3.6.1.2.1.2.2.1.2 -On`;
    
    my $suffix = undef;
    
    my @iface_list = split(/n/, $res);
    
    foreach my $line (@iface_list) {
    
            #Parse snmpwalk line
            if ($line =~ m/^([d|.]+) = STRING: (.*)$/) {
                    my $aux = $1;
    
                    #Chec if this is the interface requested
                    #if ($2 eq $ifname) {
                    # Changed to ifname substring of inteface desc for changing ifsuffix on CP.
                    if (index($2, $ifname) != -1) {
    
                            my @suffix_array = split(/./, $aux);
    
                            #Get last number of OID
                            $suffix = $suffix_array[$#suffix_array];
                    }
            }
    }
    
    #Check if iface name was found
    if (defined($suffix)) {
            #Get octets stats
            my $inoctets = `snmpget -L n $ip -c $community -v1 .1.3.6.1.2.1.2.2.1.10.$suffix -OUevqt`;
            my $outoctets = `snmpget -L n $ip -c $community -v1 .1.3.6.1.2.1.2.2.1.16.$suffix -OUevqt`; 
    
            print $inoctets+$outoctets;
    }
    
  2. hello, Since version 5.1 has changed the way we run plugins. So, being a server plugin, try deleting and register it again. Can you attach a plugin settings screenshot? Regards

  3. I cannot delete and register the plug-ins since they are in use as monitors on several agents and I do not have time to rework the system because of changes where the impact to the user is not considered. I am attaching screen shots below. The first two plug-ins (Get Network Usage Data and Dell Warranty Check),  do not work and the last one (Net Device Data from ECM) does work. As indicated previously, all the plug-ins worked prior to the upgrade. Thank You, Chuck Andrews

    [

    ](//pandorafms.com/community/media/forum/0/17897=747-5599438141652992-1.png)

    [

    ](//pandorafms.com/community/media/forum/0/17897=748-6096627985022976-2.png)

    [

    ](//pandorafms.com/community/media/forum/0/17897=749-5410657618886656-3.png)

  4. hello, in _field1_ have to add macros, for example _address_. In plug-parameters is fine, but in "Description" you have to put macros. Regards

  5. This issue is still open. I have tried removing one of the plug-ins and re-adding and the results are the same. I am frustrated that all of these plugins worked for years and the update appears to have rendered them useless. Please advise.

  6. I think the problem may be that there was a version of that script added to the product.  I noticed an iface_bandwidth.pl in the /usr/share/pandora_server/util/plugin directory.  You might try renaming it to see if the problems go away.  If so I'd recommend renaming your plugin and adjusting the module so that you don't get burned on the next upgrade.

  7. I think the problem may be that there was a version of that script added to the product.  I noticed an iface_bandwidth.pl in the /usr/share/pandora_server/util/plugin directory.  You might try renaming it to see if the problems go away.  If so I'd recommend renaming your plugin and adjusting the module so that you don't get burned on the next upgrade.

    Thanks for the suggestion but I'm not sure I follow. None of my plug in scripts use that name currently nor do they call that script. Am I missing something? Thanks again!

  8. That was the name in the script you posted. Anyways, if you go to Manage servers, then Manage plug-ins, do you see your plugin listed?  If so click on the wrench icon to edit it. Does it have the right path to the script? Do the plugin parameters look right?  In the example you posted it should be something like: -ip _field1_ -com _field2_ -if _field3_ Now go to the screen to edit the module that isn't working. Make sure the plugin selected is the right one. Make sure there are the three fields shown below the plugin name and that they have the correct values. Hope that helps.

Entra en tu cuenta para publicar.