cli/add_tree.php not working properly

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
leonardo_gyn
Cacti User
Posts: 85
Joined: Sat Jan 22, 2005 4:51 pm

cli/add_tree.php not working properly

Post by leonardo_gyn »

Hello Guys,

I got 0.8.7b running and i'm trying to create new graph trees through cli command line scripts. And things didnt seem to be working as expected.

Starting from a completly clean 'graph tree':

Code: Select all

[root@cacti cli]# php add_tree.php --list-trees
Known Trees:
id      sort method                     name
[root@cacti cli]# 
I'll create a new tree:

Code: Select all

[root@cacti cli]# php add_tree.php --type=tree --name="Testing" --sort-method=manual           
Tree Created - tree-id: (5)
[root@cacti cli]# 
Let's create 3 (three) headers on our newly created tree:

Code: Select all

[root@cacti cli]# php add_tree.php  --tree-id=5 --type=node --sort-method=manual --node-type=header --name="Andradina"          
Added Node node-id: (244)

[root@cacti cli]# php add_tree.php  --tree-id=5 --type=node --sort-method=manual --node-type=header --name="Barra do Garças"
Added Node node-id: (245)

[root@cacti cli]# php add_tree.php  --tree-id=5 --type=node --sort-method=manual --node-type=header --name="Rondônia"       
Added Node node-id: (246)
[root@cacti cli]# 
and now let's create new headers on these newly created headers

Code: Select all

[root@cacti cli]# php add_tree.php --tree-id=244 --type=node --node-type=header --name="Tráfego das Interfaces"        
Added Node node-id: (247)

[root@cacti cli]# php add_tree.php --tree-id=245 --type=node --node-type=header --name="Tráfego das Interfaces" 
Added Node node-id: (248)

[root@cacti cli]# php add_tree.php --tree-id=246 --type=node --node-type=header --name="Tráfego das Interfaces" 
Added Node node-id: (249)
[root@cacti cli]# 

Now let's go to cacti web interface .... i can see the created tree, i can see the created first nodes, but i cannot see the nodes inside nodes. I can expand and nothing appears. Screenshow follows attached.

am i doing something wrong ???
Attachments
BEFORE expanding created headers
BEFORE expanding created headers
cacti before expand headers.jpg (105.57 KiB) Viewed 2355 times
AFTER expanding created headers ... everything is empty
AFTER expanding created headers ... everything is empty
cacti after expand headers.jpg (104.09 KiB) Viewed 2355 times
leonardo_gyn
Cacti User
Posts: 85
Joined: Sat Jan 22, 2005 4:51 pm

Post by leonardo_gyn »

sorry for bringing this thread up ..... but i would like someone to at least confirm this ....
thomasw
Posts: 33
Joined: Thu Nov 10, 2005 6:11 am

wrong syntax in use

Post by thomasw »

Hi,

you are trying to create the "sub-headers" with wrong syntax:

Tree-Id will always be 5, because there is only one tree.

you have to use the parent-node=ID if you want to put something under the created headers

i.e. parent-node=244 to put something under "Andradina" header...

Code: Select all

php add_tree.php --tree-id=5 --parent-node=244 --type=node --node-type=header --name="Tráfego das Interfaces" 
... will do it....


hope it helps,

tom
leonardo_gyn
Cacti User
Posts: 85
Joined: Sat Jan 22, 2005 4:51 pm

Post by leonardo_gyn »

man .... i think i owe you a beer :)

you're completly correct, i was missing the --parent-node thing. Just used and everything works just fine as it's supposed.

Thanks for the information !
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest