Advertisement

06.29.2006 at 07:32AM PDT, ID: 21903477
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

XML to MySQL

Asked by cdukes in Perl Programming Language, Extensible HTML (XHTML)

Tags: , ,

I have a (large - about 27k entries) xml file that I need to import into mysql.
It’s a dump of the Cisco error message database and I want to import it to use on the syslog server so that when a message comes in, it will display more info w/o having to go to CCO and look it up manually.

Here’s what the xml looks like:

<?xml version="1.0"?>

<cemdb class="simple">
  <date>2006-06-28</date>
  <error name="%">
    <explanation></explanation>
    <action></action>
  </error>
  <error name="%">
    <explanation>The POST has reported an incorrect memory size.</explanation>
    <action>Replace the EAIM.</action>
  </error>
  <error name="%00:00:00:00:00:00">
    <explanation>This is not a valid MAC address, and is probably being generated by non 802.1d
compliant hardware or software in the network. When there is a request to show the hosts the switch
has learned, it must sort the MAC addresses it has learned to reply to the request. The sort algorithm
cannot deal with a MAC address which is all zeroes, so the address will not be included in the table
of hosts which needs to be sorted. This means that even though the switch has learned a host with an
all zero MAC address, it will not show up in any display of hosts the switch has learned.</explanation>
    <action>Track down the source of this bad address.</action>
  </error>
  <error name="%AAA-1-AAA_SESSION_LIMIT_REJECT: aaa request rejected as maximum aaa sessions are in progress.">
    <explanation>The AAA request is rejected because the maximum limit for concurrent AAA sessions
was reached.</explanation>
    <action>If you purchased Cisco support through a Cisco reseller, contact the reseller
directly. If you purchased support directly from Cisco Systems, contact Cisco Technical Support.
Introduced Cisco MDS SAN-OS Release 1.3(1).</action>
  </error>
  <error name="%AAA-2-AAAMULTILINKERROR: [chars]([hex]): Acct db for Id [hex] absent">
    <explanation>An AAA internal error has occurred.</explanation>
    <action>Copy the error message exactly as it appears on the console or in the system
log, contact your Cisco technical support representative, and provide the representative with the
gathered information.</action>
  </error>
  <error name="%AAA-2-AAAMULTILINKERROR: [chars]([hex]): Acct db for Id [hex] absent">
    <explanation>An AAA internal error has occurred.</explanation>
    <action>Copy the error message exactly as it appears on the console or in the system log, contact your Cisco technical s
upport representative, and provide the representative with the gathered information.</action>
  </error>
  <error name="%AAA-2-AAA_NVRAM_UPGRADE_FAILURE: upgrading of accounting log failed. [chars].">
    <explanation>The accounting log could not be upgraded because of a problem with NVRAM. The
problem is described in the error message.</explanation>
    <action>If you purchased Cisco support through a Cisco reseller, contact the reseller
directly. If you purchased support directly from Cisco Systems, contact Cisco Technical Support.
Introduced  Cisco MDS SAN-OS Release 2.0(1b).</action>
  </error>
  <error name="%AAA-2-AAA_PROGRAM_EXIT: aaa daemon exiting: [chars].">
    <explanation>The AAA daemon is exiting.</explanation>
    <action>If you purchased Cisco support through a Cisco reseller, contact the reseller
directly. If you purchased support directly from Cisco Systems, contact Cisco Technical Support.
Introduced  Cisco MDS SAN-OS Release 1.3(1).</action>
  </error>
</cemdb>



And here’s the mysql table:
CREATE TABLE cemdb (
id bigint(20) unsigned NOT NULL auto_increment,
name varchar(128) NOT NULL default '',
error text,
descr text,
action text,
datetime datetime default NULL,
PRIMARY KEY  (id),
UNIQUE KEY name (name)
) ENGINE=MyISAM;

Can someone please write a perl script to import this into mysql for me?
Start Free Trial
[+][-]06.29.2006 at 09:29AM PDT, ID: 17011064

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2006 at 09:35AM PDT, ID: 17011115

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2006 at 09:46AM PDT, ID: 17011221

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2006 at 04:07PM PDT, ID: 17014413

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.30.2006 at 06:58AM PDT, ID: 17017887

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, Extensible HTML (XHTML)
Tags: cemdb, cisco, import
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 2
Solution Grade: B
 
 
[+][-]06.30.2006 at 08:16AM PDT, ID: 17018575

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32