Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scroll Ignore
scroll-pdftrue
scroll-officetrue
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmltrue
Panel
titleSommaire

Table of Contents
maxLevel4
stylenone

Erreurs communes à toutes les requêtes HTTP

Authentification requise

Si le module a été configuré pour demander un nom d'utilisateur et un mot de passe et que ces derniers n'ont pas été fournis, un code d'erreur 401 est retourné.

Exemple :

  • La requête ( le -u user:password est manquant ) :
No Format
curl -X POST -d $'host_name=host-checked&service_description=service-checked&return_code=0&output=short_update\nlong_output' http://shinken-srv:7760/push_check_result
  • La réponse :
No Format
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error 401: Unauthorized</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error 401: Unauthorized</h1>
            <p>Sorry, the requested URL <tt>'http://shinken-srv:7760/push_check_result'</tt>
               caused an error:</p>
            <pre>Authentication required</pre>
        </body>
    </html>

Authentification refusée

Si le module a été configuré pour demander un nom d'utilisateur et un mot de passe et que ceux donnés sont invalides ( mauvais nom d'utilisateur ou mauvais mot de passe ), un code d'erreur 403 est retourné.

Exemple :

  • La requête :
No Format
curl -u invalid_user:invalid_password -X POST -d $'host_name=host-checked&service_description=service-checked&return_code=0&output=short_update\nlong_output' http://shinken-srv:7760/push_check_result
  • La réponse :
No Format
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error 403: Forbidden</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error 403: Forbidden</h1>
            <p>Sorry, the requested URL <tt>'http://shinken-srv:7760/push_check_result'</tt>
               caused an error:</p>
            <pre>Authentication denied</pre>
        </body>
    </html>

Le nom de l'hôte est manquant

Les appels HTTP pour une action sur un hôte/un check où le nom de l'hôte concerné n'a pas été fourni retournent un code d'erreur 400.

Exemple :

  • La requête :
No Format
curl -u user:password -X POST -d "time_stamp=$(date +%s)&host_name=&service_description=service-checked&comment=Nous sommes entrain de corriger le problème&notify=1" http://shinken-srv:7760/acknowledge
  • La réponse :
No Format
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error 400: Bad Request</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error 400: Bad Request</h1>
            <p>Sorry, the requested URL <tt>'http://shinken-srv:7760/acknowledge'</tt>
               caused an error:</p>
            <pre>Missing parameter host_name</pre>
        </body>
    </html>

Le format de la requête n'est pas en UTF-8

Une requête avec un message qui n'est pas au format UTF-8 retourne un code d'erreur 400.

Exemple :

  • La requête ( le fichier invalid-file.txt aurait des caractères invalides ):
No Format
curl -u user:password -X POST -d "time_stamp=$(date +%s)&host_name=&service_description=service-checked&comment=$(cat invalid-file.txt)&notify=1" http://shinken-srv:7760/acknowledge
  • La réponse :
No Format
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error 400: Bad Request</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error 400: Bad Request</h1>
            <p>Sorry, the requested URL <tt>'http://localhost:7760/acknowledge'</tt>
               caused an error:</p>
            <pre>The body is not UTF-8 encoded</pre>
        </body>
    </html>