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) 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?
The reason I'm wondering is because we're currently using a self scripted inventory registry for servers, and would like to know the possibility to add new devices by pushing info from this registry to the NAV database, without depending on using NAVs GUI to add new devices.
I hope the question wasn't too complicated.
Regards,
------------------------------------------------------ Vidar Stokkenes Networking Consulant Networking and telecom Department HN IKT - Tromsø
Tlf: 76 16 61 87 / 77 66 99 55 Cell: 95 87 99 42 e-mail: vidar.stokkenes@hn-ikt.no
Before printing, think about the environment
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.
A more precise question would be if direct push into the SQL database is sufficient for new devices/rooms/locations, or if I need to execute stuff from the shell as well. But you already answered my question, so thanks a lot! :)
-Vidar
-----Original Message----- From: Morten Brekkevold [mailto:morten.brekkevold@uninett.no] Sent: 3. april 2009 14:54 To: Stokkenes Vidar Cc: 'nav-users@uninett.no' Subject: Re: Questions regarding adding devices to NAV from a different frontend.
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.
-- mvh Morten Brekkevold UNINETT