Skip to content
Snippets Groups Projects
Commit baa5cbfe authored by Michele Grandolfo's avatar Michele Grandolfo
Browse files
parents 4a76a692 18d2d55e
No related branches found
No related tags found
1 merge request!1Zabbix external script dev + alert script
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
File mode changed from 100644 to 100755
#!/bin/bash
python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/hypervisor-show
#python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/hypervisor-show
python /usr/lib/zabbix/externalscripts/zabbix-external-scripts/hypervisor-show
......@@ -49,6 +49,7 @@ class api_request():
res = conn.getresponse()
response = api_response(res.status, res.read(), res.msg)
return response
@staticmethod
def httpsGet(url, host, port, header):
conn = httplib.HTTPSConnection(host, port)
......@@ -56,6 +57,7 @@ class api_request():
res = conn.getresponse()
response = api_response(res.status, res.read(), res.msg)
return response
@staticmethod
def httpPost(url, host, port, params, headers):
conn = httplib.HTTPConnection(host, port)
......@@ -63,6 +65,7 @@ class api_request():
res = conn.getresponse()
response = api_response(res.status, res.read(), res.msg)
return response
@staticmethod
def httpsPost(url, host, port, params, headers):
conn = httplib.HTTPSConnection(host, port)
......@@ -89,7 +92,6 @@ def add_service_to_host(struct, host, service, state):
def add_service(struct, service, state):
struct[service] = state
class Prisma:
__username = ''
__tenant = ''
......@@ -315,10 +317,13 @@ def check( test_json):
continue
for i in iter(network_dic):
neutron &= network_dic[i]
#cinder
cinder = test_json["cinder"]
#glance
# glance = test_json["glance"]
#compute
computerun = 0
computecount = 0
......@@ -339,11 +344,12 @@ def check( test_json):
if cinder == 1:
add_service(status, 'storage', 'OK')
else
else:
add_service(status, 'storage', 'KO')
if neutron == 1:
add_service(status, 'network', 'OK')
else add_service(status, 'network', 'KO')
else:
add_service(status, 'network', 'KO')
if compute == 1:
add_service(status, 'available_nodes', computerun)
add_service(status, 'total_nodes', computecount)
......@@ -352,6 +358,7 @@ def check( test_json):
add_service(status, 'total_nodes', computecount)
return json.dumps(status, sort_keys=False, indent=4)
# return status
# return keystone & compute & nova & neutron & cinder & glance
......
#!/bin/bash
python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/prisma-iaas
#python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/prisma-iaas
python /usr/lib/zabbix/externalscripts/zabbix-external-scripts/prisma-iaas
[token]
id =
expires =
[tenant]
id =
expires =
File mode changed from 100644 to 100755
#!/bin/bash
for i in {1..500}
do
python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/ceilometer $1 $2
python /usr/lib/zabbix/externalscripts/zabbix-external-scripts/ceilometer $1 $2
#sleep `perl -e 'printf("%.2f\n", rand())'`
done
wait
File mode changed from 100644 to 100755
#!/bin/bash
python "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/ceilometer-mock $1 $2
python /usr/lib/zabbix/externalscripts/zabbix-external-scripts/ceilometer-mock $1 $2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment