Vous pouvez exécuter des vérifications à distance telles que Ping, TCP et HTTP sur les serveurs physiques et collecter des données personnalisées qui peuvent ensuite être utilisées comme mesures.

Procédure

  1. Mettez à jour la configuration Telegraf dans le serveur physique cible après avoir exécuté l'exemple de script. Ajoutez les éléments suivants dans le fichier http.conf.
    • Pour la vérification ping :
      [[inputs.ping]]
      ## Hosts to send ping packets to.
      urls = ["www.vmware.com"]
      
      ## Number of ping packets to send per interval.  Corresponds to the "-c"
      ## option of the ping command.
      # count = 1
      
      ## Time to wait between sending ping packets in seconds.  Operates like the
      ## "-i" option of the ping command.
      # ping_interval = 1.0
      
      ## If set, the time to wait for a ping response in seconds.  Operates like
      ## the "-W" option of the ping command.
      # timeout = 1.0
      
      ## If set, the total ping deadline, in seconds.  Operates like the -w option
      ## of the ping command.
      # deadline = 10
      
      ## Interface or source address to send ping from.  Operates like the -I or -S
      ## option of the ping command.
      # interface = ""
    • Pour la vérification TCP :
      [[inputs.net_response]]
      name_override="netresponse"
      ## Server address (default localhost)
      address = "10.10.10.10:443"
      protocol = "tcp"
      
      ## Set timeout
      # timeout = "1s"
      
      ## Set read timeout (only used if expecting a response)
      # read_timeout = "1s"
      
    • Pour la vérification HTTP :
      # HTTP/HTTPS request given an address a method and a timeout
      [[inputs.http_response]]
      name_override="httpresponse"
      ## List of url to query.
      address = https://10.10.10.10/suite-api/api/adapters
      method = "GET"
      
      ## Set http_proxy.
      ## Telegraf uses the system wide proxy settings if it's is not set.
      # http_proxy = http://localhost:8888
      
      ## Set response_timeout (default 5 seconds)
      # response_timeout = "5s"
      
      ## Whether to follow redirects from the server (defaults to false)
      # follow_redirects = false
      
      ## Optional name of the field that will contain the body of the response.
      ## By default it is set to an empty String indicating that the body's content won't be added
      # response_body_field = ''
      
      ## Optional substring or regex match in body of the response (case sensitive)
      # response_string_match = "\"service_status\": \"up\""
      # response_string_match = "ok"
      # response_string_match = "\".*_status\".?:.?\"up\""
      
      
      ## Optional SSL Config
      # ssl_ca = "/etc/telegraf/ca.pem"
      # ssl_cert = "/etc/telegraf/cert.pem"
      # ssl_key = "/etc/telegraf/key.pem"
      
      
      ## Use SSL but skip chain & host verification
      insecure_skip_verify = true
      
      ## HTTP Request Headers (all values must be strings)
      [inputs.http_response.headers]
      accept = "application/json" Authorization = "OpsToken a16f7a2b-b033-48bc-9827-2daf8e205537::ec11ee5f-8623-4558-a904-8b4ea3f6f47d"
  2. Redémarrez Telegraf et attendez 10 minutes pour obtenir les données.

Que faire ensuite

Vous pouvez afficher les mesures en sélectionnant l'objet approprié dans l'onglet Mesures de l'interface utilisateur de VMware Aria Operations :
  1. Dans le menu de gauche, cliquez sur Environnement > Groupes personnalisés.
  2. Dans le volet de droite, cliquez sur l'objet Monde des systèmes d'exploitation.
  3. Accédez à l'onglet Mesures, puis sélectionnez l'objet de SE correspondant.
  4. Sous Objet du système d'exploitation, vous trouverez les objets Ping, TCP et HTTP.