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 :
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 |
<!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> |
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 :
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 |
<!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> |
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 :
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¬ify=1" http://shinken-srv:7760/acknowledge |
<!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> |
Une requête avec un message qui n'est pas au format UTF-8 retourne un code d'erreur 400.
Exemple :
curl -u user:password -X POST -d "time_stamp=$(date +%s)&host_name=&service_description=service-checked&comment=$(cat invalid-file.txt)¬ify=1" http://shinken-srv:7760/acknowledge |
<!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> |