add device using command line and place it onto existing tre

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
syedali
Posts: 4
Joined: Mon Jan 08, 2018 6:39 am

add device using command line and place it onto existing tre

Post by syedali »

hi ,

i am having issues where i can add the device but not able to add them onto tree subtree header. script is below in bash.
can you also help me for a correct syntax to delete and disable the device .

my device list is stored in simple text file, and it works with vmware. this is for datacenter where we have new vm's added and removed on very frequent basis.



devicelist=cat /home/syed/list
add_device=/var/www/html/cacti/cli/add_device.php


for i in $(cat /home/syed/list); do
php -q $add_device --description=$i --ip=$i --avail="ping" --ping_method="tcp"

done
wait
syedali
Posts: 4
Joined: Mon Jan 08, 2018 6:39 am

Re: add device using command line and place it onto existing

Post by syedali »

syedali wrote:hi ,

i am having issues where i can add the device but not able to add them onto tree subtree header. script is below in bash.
can you also help me for a correct syntax to delete and disable the device .

my device list is stored in simple text file, and it works with vmware. this is for datacenter where we have new vm's added and removed on very frequent basis.



devicelist=cat /home/syed/list
add_device=/var/www/html/cacti/cli/add_device.php


for i in $(cat /home/syed/list); do
php -q $add_device --description=$i --ip=$i --avail="ping" --ping_method="tcp"

done
wait
-----------------

i can get to display header but not able to select and list hosts in that header

[root@thomsons-noc cli]# php -q add_tree.php --list-nodes --tree-id=13 --node-type=header
Known Tree Nodes:
type id parentid title attribs
Header 618 N/A test Alphabetic Ordering
Header 1430 N/A qa-auto Manual Ordering (No Sorting)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: add device using command line and place it onto existing

Post by netniV »

That would be because I think you've miss the one important step. Adding the new device to the tree.

You can do this manually I think using the same cli/* scripts (though I've never used these in anger so I am not sure) or use automation rules to place them
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests