Skip to main content
Question

Error importing services.cfg via CLAPI

  • December 9, 2022
  • 5 replies
  • 129 views

Forum|alt.badge.img+8

Hi, I’m trying to import services via CLAPI but I get an error.

I have imported hosts, hostTemplates and other .cfgs without problems, even serviceTemplates.cfg but now I get and objectNotFound error.

 

I dont know why this happens, I have alredy imported the serviceTemplates… Any idea?

5 replies

ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • December 9, 2022

👋

 

@aalz0  Did you follow the format here?

 

https://docs.centreon.com/docs/api/clapi/#import

 

and do the actions for services match?

 

https://docs.centreon.com/docs/api/clapi/#services

 

🤔

 


Forum|alt.badge.img+8
  • Author
  • Builder *
  • December 12, 2022

Thanks for the reply, I will try to do the actions for services match.

 


Forum|alt.badge.img+8
  • Author
  • Builder *
  • December 12, 2022

I have try to add only one service, and I think that the problem is that for each service there can be only one servicetemplate defined. I have checked my centreon_clapi_import_commands.txt and I have multiple templates defined. 

Is there anyway to add more than one template for each service (maybe putting some special character -$, ! …) or I have to make a script to modify thw whole .txt?


Forum|alt.badge.img+8
  • Author
  • Builder *
  • December 13, 2022

The problem is that Centreon only allows to add ONE servicetemplate to a service, but it allows to more than one template to a Host.

In NagiosQL there is the possibilitie to add more than one template to Hosts and to Services, why has been this changed? Its only for the last version or this happens in all versions? It makes no sense for me.

 

Which the way to use more than one template for a service? Doing a categorie?


ponchoh
Centreonian
Forum|alt.badge.img+14
  • Centreonian
  • December 14, 2022

Is it possible that we might be talking about “Inheritance” as they build on each other

 

https://docs.centreon.com/docs/monitoring/basic-objects/services-templates/#inheritance

 

🤞