关于批量添加就三个文件:add_hosts.sh,ips.txt,thold_test.php,关于如何使用,更是简单
./add_hosts.sh --add #执行批量工作./add_hosts.sh --help #查看帮助
1、cli/add_host.sh
2、cli/ips.txt
- [root@s_name cli]# cat ips.txt
- s0.name 192.168.1.200 5
- s1.name 192.168.1.210 5
- s2.name 192.168.1.220 6
3、plugins/thold/thold_test.php
- [root@s_name thold]# cat plugins/thold/thold_test.php
- <?php
- chdir (‘../../‘);
- include ( "./include/global.php" );
- include_once ( $config [‘library_path‘] . ‘/rrd.php‘);
- include_once ( $config [‘base_path‘] . ‘/plugins/thold/thold_functions.php‘);
- $hostid = $_SERVER [‘argv‘][1];
- #print $hostid ;
- $c = autocreate( $hostid );
- if ( $c == 0) {
- print ‘Either No Templates or Threshold(s) Already Exists - No thresholds were created.‘;
- }