zabbix-tools/mib2zabbix

Circular data structures not supported (XML::Simple 2.22)

akayueh opened this issue ยท 18 comments

Hi Ryan

Have just download mib2zabbix script, but I am getting the following error message with running:

syu@ubuntu:~/mib2zabbix$ perl ./mib2zabbix.pl -o .1.3.6.1.4.1.24391.4.1
**Smartmatch is experimental at ./mib2zabbix.pl line 429.
circular data structures not supported at ./mib2zabbix.pl line 824.**

Line 824, XML output?

Note also that although you can nest hashes and arrays to arbitrary levels, circular data structures are not supported and will cause XMLout() to die.

If you wish to 'round-trip' arbitrary data structures from Perl to XML and back to Perl, then you should probably disable array folding (using the KeyAttr option) both with XMLout() and with XMLin(). If you still don't get the expected results, you may prefer to use XML::Dumper which is designed for exactly that purpose.

http://search.cpan.org/~grantm/XML-Simple-2.22/lib/XML/Simple.pm

Can you please attach or post a link to the MIB file that is causing the error? I can't replicate the issue to confirm a solution with my current set of MIBs.

try the DCPLAYER one

Can confirm get the same issue with VMWARE mibs as well
1013445_VMware-mibs-6.2.0-3963776.zip

Perl v5.22.1
XML::Simple 2.22

To speed things up your latest commit 20bfdd8:

If you run below.

./mib2zabbix.pl -o .1.3.6.1.4.1.6876

You should get the errors as below.

Smartmatch is experimental at ./mib2zabbix.pl line 465.
circular data structures not supported at ./mib2zabbix.pl line 908.

Odd... The DC Player MIB files translate okay for me. No errors. DOREMI-HQ-REG-MIB-drmdcDCPlayerMib.xml.txt

Perl v5.18.2
XML::Simple 2.20
SNMP v5.7.2

Let me try VMware...

No errors encountered on the vmware MIBs either with ./mib2zabbix.pl -o .1.3.6.1.4.1.6876.
vmware.xml.txt

Let me see if I can figure out what's going on.

I will double check my environment, are you running Ubuntu as the base? Where do you place the mibs? And are you loading only the specifics mibs or loading all mibs?

Thanks

Steven

Sent from my iPad

On 17 Aug 2016, at 6:40 PM, Ryan Armstrong notifications@github.com wrote:

Odd... The DC Player MIB files translate okay for me. No errors. DOREMI-HQ-REG-MIB-drmdcDCPlayerMib.xml.txt

Perl v5.18.2
XML::Simple 2.20
SNMP v5.7.2

Let me try VMware...

โ€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Certainly seems to be environmental somewhere as works fine in:

Centos 7
Perl 5.16.3
XML simple 2.20
SNMP 5.0702

But errors under:

Ubuntu 16.04
Perl 5.22.1
XML simple 2.22
SNMP 5.0703

I'm loading all mibs in both enviroments and dont think it the mib parsing side of the code personally as looks ok under Data:Dumper at first glance. My guess is XML simple 2.22

Ok just cpan updated the version of XML::Simple in working Centos 7 enviroment to 2.22 and get the

circular data structures not supported error

Manually deleted
/usr/local/share/perl5/XML/Simple.pm (cpan v2.22)

so it used rpm version again and all fine

/usr/share/perl5/vendor_perl/XML/Simple.pm

so looks to be a change or bug in V2.22 of XML Simple itself. CPAN update to 2.22 did also update some dependencies but these will have remained in play when deleting XML/Simple.pm(v2.22) by hand so in my mind issue lies in module itself and not its dependencies.

Will try and install V2.20 in my ubuntu enviroment and prove if that works but 2.20 doesnt seem to be on cpan anymore.

I'm guessing the source of the issue is this bug fix in 2.22

grantm/xml-simple@6d680d8

but would need to take a deep look at the code and how it all interacts to figure where we go next and dont have that time right now.

Confirmed the issue is with XML simple 2.22, I have manually removed and install 2.20 in my testing environment, and ites working fine.

Did this get reported upstream?

Edit: Never mind, working in XML::Simple 2.24.

Fixed by upstream in XML::Simple 2.24 (couldn't find release notes)

Ryan please check your email I need help

oot@ubuntu:/var/tmp/mib2zabbix-master# ./mib2zabbix.pl -f /var/tmp/nimble.xml -N /var/tmp/NIMBLE.mib -e -o .1.3.6.1
Smartmatch is experimental at ./mib2zabbix.pl line 475.
OID .1.3.6.1 not found in MIB tree.

Pretty please

I have similar error

Smartmatch is experimental at bin/mib2zabbix line 475.
OID .1.3.6.1.4.1.3699 not found in MIB tree.

I am trying to convert this mib file from this device
http://www.networktechinc.com/download/enviromux-1w-v1-00.mib

Hi everybody,

I am Still facing the issue "Smartmatch is experimental", tried some Perl Versions using Perlbrew, no luck so far. the mentioned XML::Simple 2.20 seems to not compile using CPAN on recent Perl versions. Any hint?