Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon May 22, 2017 10:22 am

All times are UTC - 5 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Batch create Host and all Graphs in one run
PostPosted: Fri May 15, 2009 4:50 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Support for cli scripts to create cacti objects in batch was a great leap ahead.

But usually, to meet your own requirements, you will have to write some code to glue things together. You may have found some contributions of this kind already. Now I've found time to add my 2 cents.

Please find attached a php script, that

- creates a host and relates it to a host template
- creates all simple Graphs related to that host via the given Host Template
- creates some Data Query based graphs as
-- interface traffic for a selected subset of interfaces
-- errors/discards for a selected subset of interfaces
-- disk usage for selected filesystems
-- diskio for selected filesystems

This may serve as a base for your own work.

CAVEAT
This scripts holds numerous target specific constants, e.g. snmp community string and numerical ids of templates and stuff. You MUST change them to your settings. This will require a certain knowledge of existing cli scripts. So you may want to read the documentation at e.g. http://docs.cacti.net/manual:087:6_refe ... _add_graph


Please use AUTOM8 now!


Attachments:
File comment: The Script.
REMEMBER TO CHANGE ALL PARAMETERS TO FIT YOUR NEED.
ELSE, YOU WILL BREAK YOUR CACTI!

add_linux_host_with_graphs.tgz [2.83 KiB]
Downloaded 2740 times

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject: Re: Batch create Host and all Graphs in one run
PostPosted: Sun Mar 13, 2011 8:11 am 
Offline
Cacti User

Joined: Mon Jan 17, 2011 12:15 pm
Posts: 155
Hi gandaf,

Could you give me the command line syntax please ?

Thanks in advanced


[Edit] Sorry, may be too tired yesterday, I see the syntax in the script :oops: [/Edit]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group