Generate Nagios config via CLI, possible?

Support requests, bug reports, questions etc.

Generate Nagios config via CLI, possible?

Postby afrazee » Fri May 04, 2012 03:39

Hello, just wondering if it's possible to Generate Nagios config via CLI, I tried running: /nconf/bin/generate_config.pl, however, that doesn't seem to do the same thing as clicking on the Generate Nagios config link on website. Any help is appreciated, thanks.
afrazee
beginner
beginner
 
Posts: 5
Joined: Mon Mar 19, 2012 23:45

Re: Generate Nagios config via CLI, possible?

Postby fgander » Fri May 11, 2012 22:52

What do you mean with, its not doing the same ?
It should create your config and place it in the output directory.
Sure any other kind of stuff like the deployment will not be done...

var/www/nconf/output/NagiosConfig.tgz

Perhaps you should change into the directory when executing the script.

Regards
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!
User avatar
fgander
NConf developer
NConf developer
 
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland

Re: Generate Nagios config via CLI, possible?

Postby afrazee » Sat May 12, 2012 03:57

Example:

Code: Select all
root@xxxx:/# /var/www/nconf/bin/generate_config.pl

[ Initializing NConf perl-API (library version 0.3, written by A. Gargiulo) ]
[ Copyright (c) 2006 - 2012 Sunrise Communications AG, Zurich, Switzerland  ]

[INFO]  Starting generate_config script
[INFO]  Generating global config files
[INFO]  Generating config for Nagios-collector 'Default Nagios'
[INFO]  Ended generate_config script
root@xxxx:/#


Then I try to browse to nagios via http. Nothing in the Pending list. This is after adding a host to nconf of course. However, when I click: Generate Nagios config, and then view nagios, hosts are added to pending list. I am trying to simulate this from CLI. Maybe the trick is something to do with that NagiosConfig.tgz, any help is appreciated. Thanks.
afrazee
beginner
beginner
 
Posts: 5
Joined: Mon Mar 19, 2012 23:45

Re: Generate Nagios config via CLI, possible?

Postby scrat » Sat May 12, 2012 13:17

Hi,

You have to deploy the generated config.
generate_config.pl is jus creating an archive NagiosConfig.tgz.

So extract the archive and copy it to your Nagios-dir and reload Nagios, then you'll see the new/changed hosts/services...


Regards,
René
User avatar
scrat
NConf enthusiast
NConf enthusiast
 
Posts: 101
Joined: Mon Aug 23, 2010 16:28
Location: Vienna, Austria

Re: Generate Nagios config via CLI, possible?

Postby fgander » Sat May 12, 2012 15:44

Generate will just create the package, the deployment will then help you move the files somewhere.

If you want to do that all by CLI you have to do it like scrat described.

Cheers
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!
User avatar
fgander
NConf developer
NConf developer
 
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland


Return to Support (NConf 1.3.0)

Who is online

Users browsing this forum: No registered users and 2 guests

cron