adding a batch of devices and graphs

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Locked
georgej2
Posts: 9
Joined: Thu Sep 05, 2013 2:34 pm

adding a batch of devices and graphs

Post by georgej2 »

Are there instructions on how to add a list of devices from a batch file and define graphs for them at the same time?

Thanks,

George
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: adding a batch of devices and graphs

Post by BSOD2600 »

Lots of tools in \cacti\cli\ for automation.
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

Re: adding a batch of devices and graphs

Post by jftuga »

Once you have the devices installed, check out the Autom8 plugin. It will automagically create graphs & place them on the graph tree for you. It's a really huge time-saver and is also my favorite plugin.

-John
georgej2
Posts: 9
Joined: Thu Sep 05, 2013 2:34 pm

Re: adding a batch of devices and graphs

Post by georgej2 »

Thank you for the input.

We are looking through the cli directory for a tool to add the devices and will likely use the "automagic" one to create graphs after we get the devices defined. But we need to get the 600 or so devices defined first.

We are hoping to be able to "feed" a script with a file (maybe a text file) that contains the device name, IP address, SNMP community, etc. and have it define the devices in Cacti for us.

Suggestions are always appreciated.

George
jftuga
Posts: 49
Joined: Mon Feb 07, 2011 11:50 am
Location: Athens, GA

Re: adding a batch of devices and graphs

Post by jftuga »

Get the number of the template, you want to use from this command:
php -q add_device.php --list-host-templates

let's say it is #9 (see below)
change dev1, dev2, etc.
change snmp community from public

Code: Select all

#!/bin/sh

dom="example.com"
cd /var/lib/cacti/cli/

if [ "$#" -eq "1" ] ; then
        devices=$1
else
        devices="dev1 dev2 dev3 dev4 dev5"
fi

for i in ${devices} ; do
        echo $i
        php -q add_device.php --template=9 --avail=snmp --version=2 --community=public --ip=${i}.${dom} --description=${i}
        sleep 1
        echo
done
georgej2
Posts: 9
Joined: Thu Sep 05, 2013 2:34 pm

Re: adding a batch of devices and graphs

Post by georgej2 »

Thank you for the ideas. We are not well-versed in writing/reading code or implementing scripts so we'll need to search for documents, study and interpret what that is saying. Then do some trial and error to see where that takes us. Not sure where to put the code listed above. What should we edit the dev1, dev2, etc. to? Not sure how to incorporate this with a file that has a list of devices

Thanks again,

George
georgej2
Posts: 9
Joined: Thu Sep 05, 2013 2:34 pm

Re: adding a batch of devices and graphs

Post by georgej2 »

We figured out the template part.

How would we say the rest of the code in Windows?

Thanks,

George
Daniel1212
Posts: 1
Joined: Sat Jan 09, 2021 2:08 am

Re: adding a batch of devices and graphs

Post by Daniel1212 »

Hi,
I have a question about adding devices with bulk. From cacti i can not ping 4.2.2.4 . Now i want to add this device in cacti with bulk forexample, but it failed and I get below error:
Failed to add device.
However if the IP is pingable I can add the device! Any one know how i can add a device which in not accessible in CACTI with bulk?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: adding a batch of devices and graphs

Post by TheWitness »

Well, you need to provide way more information.

1) What version of Cacti
2) What exact command did you run to add
3) Anything else, you OS, the PHP version, ...

Lastly, you should always start a separate thread, and not poach an old one.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Locked

Who is online

Users browsing this forum: No registered users and 0 guests