Thomas Wittmann
2018-08-01 11:51:31 UTC
Hello together
according to https://mathias-kettner.de/cms_web_api_references.html
i want to get information about a host (i am using 1.4.0.p31cre on SLES12sp3
But no matter what i try, i get an exception like this:
*Wed Aug 01 13:41:22.662997 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] URI:
'/<sitename>/check_mk/webapi.py'**Wed Aug 01 13:41:22.663000 2018*
*:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Location: None**Wed Aug 01 13:41:22.663003
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Directory:
'/omd/sites/**<sitename>/share/check_mk/web/htdocs/'**Wed Aug 01
13:41:22.663007 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Filename:
'/omd/sites/**<sitename>/share/check_mk/web/htdocs/webapi.py'**Wed Aug
01 13:41:22.663010 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] PathInfo: ''**Wed Aug 01
13:41:22.664329 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Traceback (most recent call last):**Wed Aug
01 13:41:22.664336 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1540</b>, in HandlerDispatch\n
default=default_handler, arg=req, silent=hlist.silent)**Wed Aug 01
13:41:22.664340 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1232</b>, in _process_target\n result =
_execute_target(config, req, object, arg)**Wed Aug 01 13:41:22.664342
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1131</b>, in _execute_target\n result =
object(arg)**Wed Aug 01 13:41:22.664344 2018* *:error * *[pid 17749]
[client 127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/index.py", line <b
class=line>48</b>, in handler\n __builtin__.html =
html_mod_python(mod_python_req, fields)**Wed Aug 01 13:41:22.664347
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/html_mod_python.py",
line <b class=line>74</b>, in __init__\n
self.set_output_format(self.var("output_format", "html").lower())**Wed
Aug 01 13:41:22.664349 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/htmllib.py", line
<b class=line>1678</b>, in set_output_format\n raise
MKGeneralException(_("Unsupported context type '%s'") % f)**Wed Aug 01
13:41:22.664352 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] MKGeneralException: Unsupported context type
'python -d request={'hostname':'<hostname'}'**Wed Aug 01
13:41:22.664596 2018* *:notice* *[pid 17749] mod_python (pid=17749,
interpreter='OMD_CMK_00'): Importing module
'/omd/sites/<sitename>/share/omd/htdocs/index.py'**Wed Aug 01
13:41:56.183308 2018* *:error * *[pid 30426] [client 127.0.0.1:51712
<http://127.0.0.1:51712>] mod_python (pid=30426, interpreter='*
*<sitename>', phase='PythonHandler', handler='index'): Application error*
These are my first steps into automation and i suspect i am doing
sometzhing wrong with the URL.
Can somebody point me in the right direction?
BR
Tom
according to https://mathias-kettner.de/cms_web_api_references.html
i want to get information about a host (i am using 1.4.0.p31cre on SLES12sp3
But no matter what i try, i get an exception like this:
*Wed Aug 01 13:41:22.662997 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] URI:
'/<sitename>/check_mk/webapi.py'**Wed Aug 01 13:41:22.663000 2018*
*:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Location: None**Wed Aug 01 13:41:22.663003
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Directory:
'/omd/sites/**<sitename>/share/check_mk/web/htdocs/'**Wed Aug 01
13:41:22.663007 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Filename:
'/omd/sites/**<sitename>/share/check_mk/web/htdocs/webapi.py'**Wed Aug
01 13:41:22.663010 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] PathInfo: ''**Wed Aug 01
13:41:22.664329 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] Traceback (most recent call last):**Wed Aug
01 13:41:22.664336 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1540</b>, in HandlerDispatch\n
default=default_handler, arg=req, silent=hlist.silent)**Wed Aug 01
13:41:22.664340 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1232</b>, in _process_target\n result =
_execute_target(config, req, object, arg)**Wed Aug 01 13:41:22.664342
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/versions/1.4.0p31.cre/lib/python/mod_python/importer.py", line
<b class=line>1131</b>, in _execute_target\n result =
object(arg)**Wed Aug 01 13:41:22.664344 2018* *:error * *[pid 17749]
[client 127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/index.py", line <b
class=line>48</b>, in handler\n __builtin__.html =
html_mod_python(mod_python_req, fields)**Wed Aug 01 13:41:22.664347
2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/html_mod_python.py",
line <b class=line>74</b>, in __init__\n
self.set_output_format(self.var("output_format", "html").lower())**Wed
Aug 01 13:41:22.664349 2018* *:error * *[pid 17749] [client
127.0.0.1:49286 <http://127.0.0.1:49286>] File
"/omd/sites/**<sitename>/share/check_mk/web/htdocs/htmllib.py", line
<b class=line>1678</b>, in set_output_format\n raise
MKGeneralException(_("Unsupported context type '%s'") % f)**Wed Aug 01
13:41:22.664352 2018* *:error * *[pid 17749] [client 127.0.0.1:49286
<http://127.0.0.1:49286>] MKGeneralException: Unsupported context type
'python -d request={'hostname':'<hostname'}'**Wed Aug 01
13:41:22.664596 2018* *:notice* *[pid 17749] mod_python (pid=17749,
interpreter='OMD_CMK_00'): Importing module
'/omd/sites/<sitename>/share/omd/htdocs/index.py'**Wed Aug 01
13:41:56.183308 2018* *:error * *[pid 30426] [client 127.0.0.1:51712
<http://127.0.0.1:51712>] mod_python (pid=30426, interpreter='*
*<sitename>', phase='PythonHandler', handler='index'): Application error*
These are my first steps into automation and i suspect i am doing
sometzhing wrong with the URL.
Can somebody point me in the right direction?
BR
Tom