say() {
/usr/local/bin/php -q /xxxxx/cacti/cli/add_device.php --description="$2" --ip="$1" --template=3 --community="public"
}
do
v1=`echo -n $i |awk -F = '{printf $1}'`
v2=`echo -n $i |awk -F = '{printf $2}'`
say $v1 $v2
echo $v1
echo $v2
done
for t in `cat idlist`
do
for i in `echo -n "4 11 13"`
do
#echo $t $i
/usr/local/bin/php -q /xxxxx/cacti/cli/add_graphs.php --host-id=$t --graph-type=cg --graph-template-id=$i
# –snmp-query-id=1 –snmp-query-type-id=13 –snmp-field=ifOperStatus –snmp-value=Up
done
done
#add_graphs.php --graph-type=[cg|ds] --graph-template-id=[ID] --host-id=[ID]
for ID in `cat idlist`
do
#add_interface
#for j in `/usr/local/bin/php /xxxxx/cacti/cli/add_graphs.php --host-id=$ID --graph-type=ds --graph-template-id=2 --snmp-query-id=1 --snmp-query-type-id=16 --snmp-field=ifDescr --list-snmp-values|grep -v ifDescr|grep -v lo|grep -v sit0`
#do
#/usr/local/bin/php /xxxxx/cacti/cli/add_graphs.php --host-id=$ID --graph-type=ds --graph-template-id=2 --snmp-query-id=1 --snmp-query-type-id=16 --snmp-field=ifDescr --snmp-value=$j
#done
#add_partition
for i in `/usr/local/bin/php /xxxxx/cacti/cli/add_graphs.php --host-id=$ID --graph-type=ds --graph-template-id=26 --snmp-query-id=8 --snmp-query-type-id=18 --snmp-field=hrStorageDescr --list-snmp-values|grep -v hrStorage|grep -v Memory|grep -v Swap|grep -v Space|grep -v Buffers|grep -v Real`
do
/usr/local/bin/php /xxxxx/cacti/cli/add_graphs.php --host-id=$ID --graph-type=ds --graph-template-id=26 --snmp-query-id=8 --snmp-query-type-id=18 --snmp-field=hrStorageDescr --snmp-value=$i
done
done