Batch/Shell script using add_device.php

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

Moderators: Developers, Moderators

Post Reply
weday0
Posts: 4
Joined: Thu Apr 29, 2010 4:36 pm

Batch/Shell script using add_device.php

Post by weday0 »

Can anyone help in getting some type of a batch file script or such for windows to add numerous devices using the add_device.php

Right now I have a txt file with about 300 lines, all lines are correct for entering into CLI on my Cacti instance. I just don't want to have to manually enter them one by one...

I have looked and looked, and found some of the old SOAP stuff that was used, along with a few other things but nothing for what I'm looking for.

Any assistance is GREATLY appreciated.

FYI, I'm running 0.8.7e on a Windows 2003 host.

Thanks,
weday0
Posts: 4
Joined: Thu Apr 29, 2010 4:36 pm

Question answered, but new question also...

Post by weday0 »

Disregard, as I resolved my own question. :)

Nothing more than saving the script list txt file as a *.bat and running it. Not pretty, but doesn't need to be to get the devices imported in......

---------------------------------------------------------------------------

I would be interested to know if anyone is experiencing a similar issue as below:

Windows 2003 box running 0.8.7e
Multiple availability options chosen via GUI
Imported with the following format script syntax:
php -q add_device.php --description="rtr-a" --ip="10.10.10.124" --template=5 --community="test123" --avail="ping" --ping_method="icmp"

Problem:
Devices added via add_device.php reporting Status: Unknown

It still continues to report Unknown no matter what, I have also changed the "recovery" option to only 1 poll, so I don't have to wait 15 minutes to see if a change worked or not.....

I have tried both cmd and spine pollers, also the devices I manually added via web GUI to report Ok and report their ping times/averages....

Just curious.
weday0
Posts: 4
Joined: Thu Apr 29, 2010 4:36 pm

question answered...again...

Post by weday0 »

found answer on another thread and tested with success.

----------------------------------------------------------------------------------------
"Here is the bottom line. You "may" not have a problem.

1) If you are running cmd.php and have not graphs created, the device remains as unknown as it is not tested since it is not polled for anything. "
----------------------------------------------------------------------------------------

Here is a link to the full thread: http://forums.cacti.net/about21559.html&highlight=
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests