Announcement

Collapse
No announcement yet.

Batch Mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch Mode

    Is there a way to enter Hosts in batch?

    ---

    Est-ce qu'il y a moyen d'entrer plusieurs hôtes en lot?

  • #2
    I don't know if there is a easy way (like a php command line), but I use a txt file with all my hosts and I make a (quite big) awk command line to generate the "nagios like configuration file" like:

    define host{
    host_name myserver
    use generic-windows
    alias myserver
    address myserver
    parents myparent
    hostgroups WindowsProd
    contact_groups IT
    }

    and then I import it in centreon (nagios conf import).

    The first time it's not very easy (awk is not too user friendly...) but it works greats.

    I hope this can help you. (sorry, I don't have the awk command but it something like:
    cat file.txt | awk '{print "define host{\n\thost_name\t",$1,"\n\tuse\tgeneric-windows\n"}'
    Auteur de Shinken, outil de supervision compatible avec Nagios et orientée supervision distribuée hautement disponible et mulitplateforme.

    Comment


    • #3
      Originally posted by naparuba View Post
      I don't know if there is a easy way (like a php command line), but I use a txt file with all my hosts and I make a (quite big) awk command line to generate the "nagios like configuration file" like:

      define host{
      host_name myserver
      use generic-windows
      alias myserver
      address myserver
      parents myparent
      hostgroups WindowsProd
      contact_groups IT
      }

      and then I import it in centreon (nagios conf import).

      The first time it's not very easy (awk is not too user friendly...) but it works greats.

      I hope this can help you. (sorry, I don't have the awk command but it something like:
      cat file.txt | awk '{print "define host{\n\thost_name\t",$1,"\n\tuse\tgeneric-windows\n"}'
      Thank you! I will try it!

      Comment

      Working...
      X