Batch create Host and all Graphs in one run

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Locked
Author
Message
User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Batch create Host and all Graphs in one run

#1 Post by gandalf » Fri May 15, 2009 4:50 am

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
add_linux_host_with_graphs.tgz
The Script.
REMEMBER TO CHANGE ALL PARAMETERS TO FIT YOUR NEED.
ELSE, YOU WILL BREAK YOUR CACTI!
(2.83 KiB) Downloaded 3070 times

c3226026
Cacti User
Posts: 87
Joined: Mon Jan 17, 2011 12:15 pm

Re: Batch create Host and all Graphs in one run

#2 Post by c3226026 » Sun Mar 13, 2011 8:11 am

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]

Locked