centreon / nagiosToCentreon

Import your nagios config files into Centreon DB... And it rocks !
Apache License 2.0
9 stars 13 forks source link

Export only RESOURCES (No host, no services) #44

Closed Tonnulus closed 6 years ago

Tonnulus commented 6 years ago

Hello, Thanks to the new version and #43 The script run without error, but the only result I have is :

RESOURCECFG;ADD;$hostsUSER2$;PUBLIC;Central;Resource $USER2$ RESOURCECFG;ADD;$hostsUSER10$;/srv/eyesofnetwork/pnp4nagios;Central;Resource $USER10$ RESOURCECFG;ADD;$hostsUSER1$;/srv/eyesofnetwork/nagios/plugins;Central;Resource $USER1$ RESOURCECFG;ADD;$hostsUSER3$;/srv/eyesofnetwork/notifier;Central;Resource $USER3$

There is no host and no service ...

cgagnaire commented 6 years ago

Hi @Tonnulus, As you have seen, this version has to be launched with the directory where is stored your configuration in the --config option. Still, your configuration files names must match the filter, the default beeing '^(?!(.|connector.cfg))(.*.cfg)$'. You can send us your files names list to help you make a filter that works for you! Thanks.

Tonnulus commented 6 years ago

Hi @cgagnaire, Thank you for your answer. Here is the contents of the directory : ├── cgi.cfg ├── nagios.cfg ├── objects │   ├── commands.cfg │   ├── contactgroups.cfg │   ├── contacts.cfg │   ├── dependencies.cfg │   ├── escalations.cfg │   ├── hostgroups.cfg │   ├── hosts.cfg │   ├── servicegroups.cfg │   ├── services.cfg │   └── timeperiods.cfg └── resource.cfg

cgagnaire commented 6 years ago

Hi @Tonnulus, Ok, it is because your other objects definitions are into the objects directory. We don't browse recursively the directories. So you should launch the command twice, first at the main directory root (for resources configuration file), then a the /objects directory (with append redirection ">>" into the same file)

Sims24 commented 6 years ago

We didn't have your feedback so we consider this issue as solved. Feel free to re-open.