Adding a large number of devices

k-wilkinson

28-12-2004 16:51:42

I would like to monitor the signal levels of some cable modems. I have quite a few to monitor, so I don't want to add them through the web gui one at a time. Is it possible to add them directly to the database with a script? Which tables and fields would I need to load the data into? Any help with this would be appreciated. Thanks.

balleman

28-12-2004 19:00:08

It's certainly possible, but not a trivial task. You'll have to add entries to the device table for each device, and then add subdevices. For interfaces, you'll have to add rows to the sub_dev_variables to get the mappings set up. The monitors and graphs themselves are much easier, as you can take advantage of the apply_template() function in processing.php that takes a subdevice and a template as parameters, and adds the appropriate monitors and adds items to the view. Unfortunately, there is no API for adding devices or sub devices at this point, although we should really work towards that.

If you end up writing a good general interface, please consider contributing it. I'm sure others would benefit. Don't hesitate to ask us for more clarification on anything.

jtingiris

05-03-2005 00:36:06

that I'm using from the command line to add devices directly to the db. It's really just a prototype, (I only spent a couple days on it). But, it works. So far, it's been a fun project and I think the gatherer is great. I just downloaded netmrg last week and have been testing it since...

The script I'm writing is is really just a prototype because first I wanted to see if the netmrg architecture could handle a couple hundred devices and snmp tests with thousands of sub devices and monitors. Although, I'm not quite there yet and still plan on updating the script to automatically add disks (just finished automatic interfaces) using snmpwalk. Tonight, I'm learning about the template graphs and view tables, and I was planning on doing that (after I got all of the monitors working).

Anyways, It should meet my needs with just a little more effort (which I plan on doing this week). If it would be helpful for others (this thread), I'd be willing to contribute and help maintain it. My setup is on Solaris 8 (haven't tested with linux), but should work (since it only uses bash, snmpwalk, and nslookup [plus sed, awk, etc.]).

What is the process to do that, here, is there a contrib SVN module or something that can be used for version control? Or, just post it here?

silfreed

06-03-2005 19:40:39

We do have a /contrib/ directory that we can put your script into. We're not sure of the legal aspects at this point as we're currently plan to re-license to GPL, and we're not sure if we'll need disclaimers or some way to 'sign code over' to us.
Our bugs database has a way to attach files if you're interested in contributing it. I'm sure any specifics would also be worked out in that forum instead of here.
Lastly, thanks for your continued use and support!

-Doug