You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-07-08 18:41:44

spinal_df
Member
Registered: 2019-02-20
Posts: 10

MibSupport

Dears,
     I need to add new info in xml file.

Well. My mini tutorial:


I add my oid in file /usr/share/fusioninventory/sysobject.ids

# IDRAC SERIAL
674.10892.2.1.1.11.0    Dell    NETWORKING      iDRAC    SERIAL

In directory "/usr/share/fusioninventory/lib/FusionInventory/Agent/SNMP/MibSupport" I create perl script mib

My code:

####################################################
package FusionInventory::Agent::SNMP::MibSupport::idrac;

use strict;
use warnings;

use parent 'FusionInventory::Agent::SNMP::MibSupportTemplate';

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::SNMP;

use constant idrac => '.1.3.6.1.4.1.674.10892';
use constant serial => idrac . '.2.1.1.11.0';

our $mibSupport = [
    {
        name => "idrac",
        sysobjectid => getRegexpOidMatch(idrac)
    }
];

sub getSerial {
    my ($self) = @_;

    return $self->get(serial);
}

1;

__END__

=head1 NAME
FusionInventory::Agent::SNMP::MibSupport::idrac - Inventory module for idrac

=head1 DESCRIPTION
This module enhances idc devices support.
####################################################

Well I this info add in my xml.

command: snmpwalk -v2c -c idc idc-009 .1.3.6.1.4.1.674.10892.2.1.1.11.0
result: SNMPv2-SMI::enterprises.674.10892.2.1.1.11.0 = STRING: "3K7G330"


Well as can I add this info in xml with this command "fusioninventory-netinventory --host  idc-009 --credentials version:2c,community:idc --debug --debug"

Parcial Result:

######################################################
[debug] creating 1 worker threads
[debug] [thread 1] creation
[debug] [thread 1] #1, scanning 0: idrac-340694
[debug] [thread 1] #1, full match for sysobjectID .1.3.6.1.4.1.674.10892.5 in database
######################################################

My doubt as I can change sysobjectID in fusioninventory-netinventory or add info additional.

My refference example link:
https://github.com/fusioninventory/fusi … issues/824

Offline

#2 2022-07-12 14:21:15

spinal_df
Member
Registered: 2019-02-20
Posts: 10

Re: MibSupport

Ready working , if your mib custom with name Idrac.pm, you name must contain in code "Idrac" --> package FusionInventory::Agent::SNMP::MibSupport::Idrac;

Final code example:

###########################
package FusionInventory::Agent::SNMP::MibSupport::Idrac;

use strict;
use warnings;

use parent 'FusionInventory::Agent::SNMP::MibSupportTemplate';

use FusionInventory::Agent::Tools;
use FusionInventory::Agent::Tools::SNMP;

use constant idrac    => '.1.3.6.1.4.1.674.10892';
use constant serial => idrac . '.2.1.1.11.0';

our $mibSupport = [
    {
        name        => "idrac",
        sysobjectid => getRegexpOidMatch(idrac)
    }
];

sub getSerial {
    my ($self) = @_;

    return $self->get(serial);
}

1;

__END__

=head1 NAME

FusionInventory::Agent::SNMP::MibSupport::Idrac - Inventory module for Idrac

=head1 DESCRIPTION

This module enhances Idrac support.

Offline

#3 2022-07-15 10:17:07

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: MibSupport

Hi spinal_df,

thank you for the sharing.

I just backported your contribution to GLPI-Agent:
https://github.com/glpi-project/glpi-ag … 95c2f04560


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

Board footer

Powered by FluxBB