Hello,
I've written a script to generate XML config files to be imported into cacti.
I'm seeing two issues when I try and import the config :
Error: XML: Cannot locate type code.
Error: XML: Hash version does not exist.
Please see attachment forcopy of my script generated XML file.
I'd welcome any help/comments on this as i'm well stumped.
Thanks,
Paul
Problems importing XML template
Moderators: Developers, Moderators
-
- Posts: 3
- Joined: Tue Apr 21, 2009 9:51 am
Problems importing XML template
- Attachments
-
- austria.xml
- (22.15 KiB) Downloaded 240 times
Search the forums -- you cannot import a newer template on and old cacti installation.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 3
- Joined: Tue Apr 21, 2009 9:51 am
Does this mean I can't generate the XML file using a script ?
How are the hash elements constructed ? in my script i'm just using random HEX characters - presumably, though, the hash element is a transformation of some other data.
Is there any documentation on creating XML files (rather than exporting from Cacti) ?
How are the hash elements constructed ? in my script i'm just using random HEX characters - presumably, though, the hash element is a transformation of some other data.
Is there any documentation on creating XML files (rather than exporting from Cacti) ?
That template was automatically generated by cacti, during a template export. No, you cannot manually make these.
If you want to try and recreate it inside cacti, read through the documentation site.
If you want to try and recreate it inside cacti, read through the documentation site.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
-
- Posts: 3
- Joined: Tue Apr 21, 2009 9:51 am
Hello,
Sorry to disagree, but that template _was_ created by my rather crude perl script.
However, I've now found the answer to my original question, so incase anyone else ever needs to know :
The hash elements in the XML are formatted (to an extent).
Taken from ~/cacti/include/global_arrays.php
$hash_type_codes = array(
"round_robin_archive" => "15",
"cdef" => "05",
"cdef_item" => "14",
"gprint_preset" => "06",
"data_input_method" => "03",
"data_input_field" => "07",
"data_template" => "01",
"data_template_item" => "08",
"graph_template" => "00",
"graph_template_item" => "10",
"graph_template_input" => "09",
"data_query" => "04",
"data_query_graph" => "11",
"data_query_sv_graph" => "12",
"data_query_sv_data_source" => "13",
"host_template" => "02"
);
and
$hash_version_codes = array(
"0.8.4" => "0000",
"0.8.5" => "0001",
"0.8.5a" => "0002",
"0.8.6" => "0003",
"0.8.6a" => "0004",
"0.8.6b" => "0005",
"0.8.6c" => "0006",
"0.8.6d" => "0007",
"0.8.6e" => "0008",
"0.8.6f" => "0009",
"0.8.6g" => "0010",
"0.8.6h" => "0011",
"0.8.6i" => "0012",
"0.8.6j" => "0013",
"0.8.7" => "0014",
"0.8.7a" => "0015",
"0.8.7b" => "0016"
);
It appears that the hash elements in the XML files are made up of the appropiate two digit $hash_type_codes followed by the four digit version code, finally followed by what looks like 32 random hex characters.
I've got my script generated XML to successfully import into cacti now, although theres something a little wrong, probably with the element linking which i'm working through today. I'll post the completed script once its fully working, even though its totally unique to my environment, and is fairly crudely written, it'll probably be a good starting point for anyone else trying to do something similar.
Regards,
Paul Miles
Sorry to disagree, but that template _was_ created by my rather crude perl script.
However, I've now found the answer to my original question, so incase anyone else ever needs to know :
The hash elements in the XML are formatted (to an extent).
Taken from ~/cacti/include/global_arrays.php
$hash_type_codes = array(
"round_robin_archive" => "15",
"cdef" => "05",
"cdef_item" => "14",
"gprint_preset" => "06",
"data_input_method" => "03",
"data_input_field" => "07",
"data_template" => "01",
"data_template_item" => "08",
"graph_template" => "00",
"graph_template_item" => "10",
"graph_template_input" => "09",
"data_query" => "04",
"data_query_graph" => "11",
"data_query_sv_graph" => "12",
"data_query_sv_data_source" => "13",
"host_template" => "02"
);
and
$hash_version_codes = array(
"0.8.4" => "0000",
"0.8.5" => "0001",
"0.8.5a" => "0002",
"0.8.6" => "0003",
"0.8.6a" => "0004",
"0.8.6b" => "0005",
"0.8.6c" => "0006",
"0.8.6d" => "0007",
"0.8.6e" => "0008",
"0.8.6f" => "0009",
"0.8.6g" => "0010",
"0.8.6h" => "0011",
"0.8.6i" => "0012",
"0.8.6j" => "0013",
"0.8.7" => "0014",
"0.8.7a" => "0015",
"0.8.7b" => "0016"
);
It appears that the hash elements in the XML files are made up of the appropiate two digit $hash_type_codes followed by the four digit version code, finally followed by what looks like 32 random hex characters.
I've got my script generated XML to successfully import into cacti now, although theres something a little wrong, probably with the element linking which i'm working through today. I'll post the completed script once its fully working, even though its totally unique to my environment, and is fairly crudely written, it'll probably be a good starting point for anyone else trying to do something similar.
Regards,
Paul Miles
Who is online
Users browsing this forum: No registered users and 3 guests