On Thu, 2 Apr 2009 15:26:01 +0200 Stokkenes Vidar Vidar.Stokkenes@hn-ikt.no wrote:
Hello,
We are currently looking into different ways to make one "authorative" device registry for servers and network equipment for our network (which is not necessarily NAV) I am simply wondering if there is any available contrib script or method to push a new Location, Room and Device into the database without using the NAV GUI? (by using a shell script, CGI, etc)
No, although that wouldn't be a bad idea. We do already have the bulk import formats, a relic from NAV version 2, but they can only be imported via the web interface. We're thinking of maybe refactoring SeedDB at some point - if we fashioned most of that into a reuseable API, it would be easier to implement some command line thingamajig to import equipment into NAV.
That way we could use a different GUI adding new devices into NAV without depending on using the GUI. I realize that a lot of it can be done by pushing stuff directly into the PostgreSQL database, but I assume I would need some shell scripting in order to add a new device to NAV?
Direct push via PostgreSQL is your only option for external modification as of today. If you like Python, though, you could also possibly use the Django ORM models in the nav.models package, bypassing SQL completely.
I wouldn't have understood your question about shell scripting, had it not been for our conversion on the IRC channel. As you explained there, it is really a question about Cricket: The Cricket configuration is generated automatically from the NAV database by a nightly cron job (makecricketconfig). This job can also be started manually to generate new Cricket configuration on-the-fly.