Ad Widget

Collapse

command-line import/export facility dynamic items, triggers and graphs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvb
    Junior Member
    • May 2011
    • 10

    #61
    The script ran fine for me and built the template as I would expect. However, when attempting to import at the host level, I got this error:

    Code:
    XML file contains errors. Fatal Error 65: attributes construct error [ Line: 23689 | Column: 16 ]
    The offending line:

    Code:
    <graph name="[Port GigabitEthernet1/36] 37 "MX480 ge-0/2/9 Trunk"" width="900" height="400">
    The problem was due to the additional quotes around "MX480 ge-0/2/9 Trunk". Once I removed those, the template imported successfully.

    What seems to give the import facility heartburn is the presence of quotes within a quoted string.

    For those working with the script, it would probably be a good idea not to use quotes in your device port descriptions. I only had to deal with one port, but I could see this being a real pain if you have hundreds or thousands of ports to contend with.

    Hopefully, this will help someone.

    Comment

    • smoc
      Junior Member
      • Mar 2012
      • 3

      #62
      Hello,
      Thx for the great tool, the script ran just fine for me but i have one problem with Cisco Router Series 3745, script is stop after FAN_4 OIDs and recive "ERROR: No response from remote host 'xxx.xxx.xxx.xxx'. Snmpwalk for this device works ok. What can i do with this ?.

      Comment

      • dima_dm
        Senior Member
        • Dec 2009
        • 2697

        #63
        Originally posted by smoc
        Hello,
        Thx for the great tool, the script ran just fine for me but i have one problem with Cisco Router Series 3745, script is stop after FAN_4 OIDs and recive "ERROR: No response from remote host 'xxx.xxx.xxx.xxx'. Snmpwalk for this device works ok. What can i do with this ?.
        Check Firewall settings, such as limits on packets per second etc. Is there any packet loss on the network? See CPU utilization on Cisco Router Series 3745.
        Last edited by dima_dm; 12-04-2012, 16:46.

        Comment

        • enzochen
          Junior Member
          • May 2012
          • 6

          #64
          the xml template not work well

          I have downloaded your script and ran it.
          But the xml I have made can not work.
          When I import the template zabbix report some errors.
          I need your help.

          Errors:
          Error in query [INSERT INTO items (itemid,description,key_,hostid,delay,history,stat us,type,snmp_community,snmp_oid,value_type,data_ty pe,trapper_hosts,snmp_port,units,multiplier,delta, snmpv3_securityname,snmpv3_securitylevel,snmpv3_au thpassphrase,snmpv3_privpassphrase,formula,trends, logtimefmt,valuemapid,delay_flex,params,ipmi_senso r,templateid,authtype,username,password,publickey, privatekey) VALUES (34046,'% CPU','Cpu',10124,60*cisco,7,0,4,'public','.1.3.6.1 .4.1.9.2.1.56.0',3,0,'',161,'',0,0,'',0,'','','1', 365,'',0,'','','',0,0,'','','','')] [Unknown column 'cisco' in 'field list']

          Cannot create Item.

          Comment

          • dima_dm
            Senior Member
            • Dec 2009
            • 2697

            #65
            Originally posted by enzochen

            Errors:
            Error in query [INSERT INTO items (itemid,description,key_,hostid,delay,history,stat us,type,snmp_community,snmp_oid,value_type,data_ty pe,trapper_hosts,snmp_port,units,multiplier,delta, snmpv3_securityname,snmpv3_securitylevel,snmpv3_au thpassphrase,snmpv3_privpassphrase,formula,trends, logtimefmt,valuemapid,delay_flex,params,ipmi_senso r,templateid,authtype,username,password,publickey, privatekey) VALUES (34046,'% CPU','Cpu',10124,60*cisco,7,0,4,'public','.1.3.6.1 .4.1.9.2.1.56.0',3,0,'',161,'',0,0,'',0,'','','1', 365,'',0,'','','',0,0,'','','','')] [Unknown column 'cisco' in 'field list']

            Cannot create Item.
            Problem in string "60*cisco", must be number.
            Check scrip parameters
            ./cisco_xml.pl Hostname HostIP 75 5 public 5 lab-cisco

            Comment

            • enzochen
              Junior Member
              • May 2012
              • 6

              #66
              thx


              many thx
              the script now works well
              thx a lot

              Comment

              • aigars
                Member
                • Apr 2010
                • 55

                #67
                Tested on Zabbix v.2.0. Script is creating template fine, but fails when importing in zabbix. I guessing something changed in new zabbix version.

                Code:
                Undefined index: delay_flex [api/classes/CItemGeneral.php:275]
                Incorrect value "180*5" for int field "delay".

                Comment

                • matjing
                  Junior Member
                  • Jun 2012
                  • 5

                  #68
                  command-line import/export facility dynamic items, triggers and graphs

                  yes I too have a similar issue on zabbix 2.0.0.

                  Code:
                      Undefined index: delay_flex [api/classes/CItemGeneral.php:275]
                      Incorrect value "180*5" for int field "delay".
                  mat
                  Attached Files

                  Comment

                  • tabolkin
                    Junior Member
                    • Aug 2012
                    • 3

                    #69
                    The format of a template changed if to compare 1.6 and 2.0,
                    it is necessary to make changes in cisco_xml.pl for a faultless import of templates

                    Comment

                    • tabolkin
                      Junior Member
                      • Aug 2012
                      • 3

                      #70
                      Originally posted by matjing
                      yes I too have a similar issue on zabbix 2.0.0.

                      Code:
                          Undefined index: delay_flex [api/classes/CItemGeneral.php:275]
                          Incorrect value "180*5" for int field "delay".
                      mat
                      to remove this error in the cisco_xml.pl file replace expression of *$slow' for a gap.

                      thus use of parameter of a time delay to become impossible

                      Comment

                      • Gagarin
                        Junior Member
                        • Jun 2011
                        • 19

                        #71
                        Originally posted by tabolkin
                        to remove this error in the cisco_xml.pl file replace expression of *$slow' for a gap.

                        thus use of parameter of a time delay to become impossible
                        After my replacement $slow integer values in script I got following error in zabbix 2.0.2:
                        ERROR: Import failed
                        ...
                        Created: Trigger "{HOSTNAME} reloaded" on Template_Cisco_C2950_10.125.0.7".
                        Item "{HOSTNAME}:Port_FastEthernet0_1_OutOctets" does not exist.

                        This template is imported without problems into zabbix 1.8.11.

                        Comment

                        • pavlod
                          Junior Member
                          • Sep 2012
                          • 1

                          #72
                          This one is work for me on Zabbix 2.0.2

                          changes:
                          - <delay>60*$slow</delay> changed to numerical values
                          - {HOSTNAME} changed to $hostname (new template format)
                          Attached Files

                          Comment

                          • sabbirjoy
                            Junior Member
                            • Sep 2012
                            • 7

                            #73
                            about template

                            Originally posted by pavlod
                            This one is work for me on Zabbix 2.0.2

                            changes:
                            - <delay>60*$slow</delay> changed to numerical values
                            - {HOSTNAME} changed to $hostname (new template format)
                            hi,i am new in zabbix and also in linux...i am trying to import your given cisco template b,but your file extension is .pl ,which is not supported ,and i saw some post to convert in xml, can you give me some easy idea or some screenshots how to convert it ,i m using my zabbix in ubuntu ...so ,here i cannt install even net snmp ...

                            Comment

                            • dima_dm
                              Senior Member
                              • Dec 2009
                              • 2697

                              #74
                              Originally posted by sabbirjoy
                              hi,i am new in zabbix and also in linux...i am trying to import your given cisco template b,but your file extension is .pl ,which is not supported ,and i saw some post to convert in xml, can you give me some easy idea or some screenshots how to convert it ,i m using my zabbix in ubuntu ...so ,here i cannt install even net snmp ...
                              You must run this perl script to generate template
                              ./cisco_xml.pl Hostname HostIP 75 5 public 5 lab-cisco
                              read this instruction

                              You may run this script on any linux system, that have SNMP access on monitored device.
                              Last edited by dima_dm; 18-10-2012, 11:59.

                              Comment

                              • dima_dm
                                Senior Member
                                • Dec 2009
                                • 2697

                                #75
                                Originally posted by pavlod
                                This one is work for me on Zabbix 2.0.2

                                changes:
                                - <delay>60*$slow</delay> changed to numerical values
                                - {HOSTNAME} changed to $hostname (new template format)
                                New version for Zabbix 2.0 cisco_xml.20121024.zip
                                minor bugfix for http://www.zabbix.com/forum/showpost...0&postcount=72

                                Comment

                                Working...