Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
269ceada
Commit
269ceada
authored
Sep 18, 2013
by
René Moser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zabbix inventory: print errors to stderr
parent
a563ea13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
plugins/inventory/zabbix.py
+4
-4
No files found.
plugins/inventory/zabbix.py
View file @
269ceada
...
...
@@ -38,7 +38,7 @@ import ConfigParser
try
:
from
zabbix_api
import
ZabbixAPI
except
:
print
"Error: Zabbix API library must be installed: pip install zabbix-api."
print
>>
sys
.
stderr
,
"Error: Zabbix API library must be installed: pip install zabbix-api."
sys
.
exit
(
1
)
try
:
...
...
@@ -111,7 +111,7 @@ class ZabbixInventory(object):
api
=
ZabbixAPI
(
server
=
self
.
zabbix_server
)
api
.
login
(
user
=
self
.
zabbix_username
,
password
=
self
.
zabbix_password
)
except
BaseException
,
e
:
print
"Error: Could not login to Zabbix server. Check your zabbix.ini."
print
>>
sys
.
stderr
,
"Error: Could not login to Zabbix server. Check your zabbix.ini."
sys
.
exit
(
1
)
if
self
.
options
.
host
:
...
...
@@ -123,11 +123,11 @@ class ZabbixInventory(object):
print
json
.
dumps
(
data
,
indent
=
2
)
else
:
print
"usage: --list ..OR.. --host <hostname>"
print
>>
sys
.
stderr
,
"usage: --list ..OR.. --host <hostname>"
sys
.
exit
(
1
)
else
:
print
"Error: Configuration of server and credentials are required. See zabbix.ini."
print
>>
sys
.
stderr
,
"Error: Configuration of server and credentials are required. See zabbix.ini."
sys
.
exit
(
1
)
ZabbixInventory
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment