4 +---------------------------------------------------------------------------+
5 | This script import cacti xml template files by command line |
6 | Author : Jean Francois Masure <jean-francois.masure@arche.fr> |
7 | Version : 0.1 8 Aug 2005 |
8 +---------------------------------------------------------------------------+
10 include_once("/usr/share/cacti/include/global.php");
11 include_once("/usr/share/cacti/lib/import.php");
13 // check if we have good number of argument
14 if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h', '-?')))
16 echo "usage : $argv[0] file.xml\n";
17 echo "this script will import file.xml template into cacti\n";
23 $fp = fopen($xml_file, "r");
26 echo "cannot open $xml_file, exiting\n";
29 $xml_data = fread($fp,filesize($xml_file));
31 // import data into cacti. $info_array will contain debugging info.
32 $info_array = import_xml_data($xml_data,false);