mkdocs
This commit is contained in:
@@ -1 +1,6 @@
|
|||||||
Dit is een catalogus van alle yamls en values in github die gebruikt worden in de clusters van AllardDCS
|
Dit is een catalogus van alle yamls en values in github die gebruikt worden in de clusters van AllardDCS
|
||||||
|
|
||||||
|
TPLINK 192.168.2.240 Tplink01
|
||||||
|
NETGEAR 192.168.2.241 Netgear01@
|
||||||
|
ZYXEL 192.168.2.242 Zyxel0101
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: backstage.io/v1alpha1
|
||||||
|
kind: Component
|
||||||
|
metadata:
|
||||||
|
name: dev-backstage
|
||||||
|
title: Backstage (dev)
|
||||||
|
description: Backstage instance running in Kubernetes
|
||||||
|
annotations:
|
||||||
|
backstage.io/kubernetes-id: backstage
|
||||||
|
argocd.argoproj.io/ignore-differences: "true"
|
||||||
|
backstage.io/techdocs-ref: dir:.
|
||||||
|
links:
|
||||||
|
- url: https://github.com/AllardKrings/kubernetes/dev/backstage
|
||||||
|
title: backstage-configuratie
|
||||||
|
docs:
|
||||||
|
- url: ./README.md
|
||||||
|
spec:
|
||||||
|
type: service
|
||||||
|
lifecycle: production
|
||||||
|
owner: group:default/allarddcs
|
||||||
|
subcomponentOf: component:default/DEV-cluster
|
||||||
|
techdocs:
|
||||||
|
builder: local
|
||||||
@@ -7,12 +7,10 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
backstage.io/kubernetes-id: backstage
|
backstage.io/kubernetes-id: backstage
|
||||||
argocd.argoproj.io/ignore-differences: "true"
|
argocd.argoproj.io/ignore-differences: "true"
|
||||||
backstage.io/techdocs-ref: dir:.
|
backstage.io/techdocs-ref: dir:. # points to root
|
||||||
links:
|
links:
|
||||||
- url: https://github.com/AllardKrings/kubernetes/dev/backstage
|
- url: https://github.com/AllardKrings/kubernetes
|
||||||
title: backstage-configuratie
|
title: backstage-configuratie
|
||||||
docs:
|
|
||||||
- url: ./README.md
|
|
||||||
spec:
|
spec:
|
||||||
type: service
|
type: service
|
||||||
lifecycle: production
|
lifecycle: production
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
site_name: Backstage Dev
|
||||||
|
repo_url: "https://github.com/AllardKrings/kubernetes"
|
||||||
|
edit_uri: "edit/master/dev/backstage"
|
||||||
|
docs_dir: "." # <-- root folder
|
||||||
|
theme:
|
||||||
|
name: mkdocs
|
||||||
|
plugins:
|
||||||
|
- techdocs-core
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
apiVersion: backstage.io/v1alpha1
|
|
||||||
kind: Component
|
|
||||||
metadata:
|
|
||||||
name: dev-deptrack
|
|
||||||
title: Deptrack (dev)
|
|
||||||
description: Dependency Track instance running in Kubernetes
|
|
||||||
annotations:
|
|
||||||
backstage.io/kubernetes-label-selector: "app=deptrack-frontend"
|
|
||||||
links:
|
|
||||||
- url: https://github.com/AllardKrings/kubernetes/dev/deptrackback
|
|
||||||
title: deptrack-configuration
|
|
||||||
docs:
|
|
||||||
- url: ./README.md
|
|
||||||
spec:
|
|
||||||
type: service
|
|
||||||
lifecycle: production
|
|
||||||
owner: group:default/allarddcs
|
|
||||||
subcomponentOf: component:default/DEV-cluster
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
sudo microk8s kubectl exec itop-66c56dd4bd-bb2t6 -- chown www-data:www-data /var/www/html/conf
|
|
||||||
exec my-itop /install-toolkit.sh
|
|
||||||
exec my-itop conf-w
|
|
||||||
exec my-itop conf-ro
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
apiVersion: backstage.io/v1alpha1
|
|
||||||
kind: Component
|
|
||||||
metadata:
|
|
||||||
name: dev-itop
|
|
||||||
title: Itop (dev)
|
|
||||||
description: Harbor instance running in Kubernetes
|
|
||||||
annotations:
|
|
||||||
backstage.io/kubernetes-label-selector: "app=itop"
|
|
||||||
links:
|
|
||||||
- url: https://github.com/AllardKrings/kubernetes/dev/itop
|
|
||||||
title: itop-configuration
|
|
||||||
docs:
|
|
||||||
- url: ./README.md
|
|
||||||
spec:
|
|
||||||
type: service
|
|
||||||
lifecycle: production
|
|
||||||
owner: group:default/allarddcs
|
|
||||||
subcomponentOf: component:default/DEV-cluster
|
|
||||||
|
|
||||||
@@ -2,15 +2,14 @@
|
|||||||
##################################################################################
|
##################################################################################
|
||||||
# #
|
# #
|
||||||
# Example script for creating a UserRequest ticket via the REST/JSON webservices #
|
# Example script for creating a UserRequest ticket via the REST/JSON webservices #
|
||||||
# #
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
|
|
||||||
# iTop location and credentials, change them to suit your iTop installation
|
# iTop location and credentials, change them to suit your iTop installation
|
||||||
ITOP_URL="https://itop.alldcs.nl"
|
##################################################################################
|
||||||
ITOP_USER="tekton"
|
ITOP_URL="https://itop-dev.allarddcs.nl"
|
||||||
ITOP_PWD="Itop01@@@"
|
ITOP_USER="admin"
|
||||||
ORGANIZATION="0002"
|
ITOP_PWD="Itop01@"
|
||||||
TITLE="Change registration"
|
ORGANIZATION="0001"
|
||||||
|
TITLE="UserRequest"
|
||||||
DESCRIPTION="Container created"
|
DESCRIPTION="Container created"
|
||||||
CALLER="0001"
|
CALLER="0001"
|
||||||
COMMENT="commentaar"
|
COMMENT="commentaar"
|
||||||
@@ -21,8 +20,8 @@ RESULT=`wget -q --post-data='auth_user='"${ITOP_USER}"'&auth_pwd='"${ITOP_PWD}"'
|
|||||||
PATTERN='"key":"([0-9])+"'
|
PATTERN='"key":"([0-9])+"'
|
||||||
if [[ $RESULT =~ $PATTERN ]]; then
|
if [[ $RESULT =~ $PATTERN ]]; then
|
||||||
echo "Change created successfully"
|
echo "Change created successfully"
|
||||||
|
echo $RESULT
|
||||||
else
|
else
|
||||||
echo "ERROR: failed to create change"
|
echo "ERROR: failed to create change"
|
||||||
echo $RESULT
|
echo $RESULT
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: itop-cron
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
schedule: "*/1 * * * *" # every minute (recommended by Combodo)
|
||||||
|
successfulJobsHistoryLimit: 1
|
||||||
|
failedJobsHistoryLimit: 3
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
backoffLimit: 1
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: itop-cron
|
||||||
|
image: vbkunin/itop:latest
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
command:
|
||||||
|
- php
|
||||||
|
- /var/www/html/webservices/cron.php
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: itop
|
||||||
|
mountPath: /var/www/html/conf
|
||||||
|
subPath: conf
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: itop
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-pvc
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
RUN apt update && apt upgrade -y
|
|
||||||
RUN apt install wget -y
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
php webservices/import.php --auth_user=login --auth_pwd=password --csvfile="location.csv"
|
|
||||||
--charset="UTF-8" --no_localize=1 --class="Location" --reconcialiationkeys="name,org_id->name"
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class itopApi {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define API details
|
|
||||||
|
|
||||||
public function __construct() {
|
|
||||||
|
|
||||||
$this->itopApi = array(
|
|
||||||
|
|
||||||
"url" => "http://itop.alldcs.nl",
|
|
||||||
|
|
||||||
"user" => "allard",
|
|
||||||
|
|
||||||
"pass" => "Itop01@"
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get details function
|
|
||||||
|
|
||||||
|
|
||||||
public function get($class,$key) {
|
|
||||||
|
|
||||||
|
|
||||||
$params['operation'] = 'core/get';
|
|
||||||
|
|
||||||
$params['class'] = $class;
|
|
||||||
|
|
||||||
$params['key'] = $key;
|
|
||||||
|
|
||||||
|
|
||||||
$execute = $this->execute($params);
|
|
||||||
|
|
||||||
RETURN $execute;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Apply stimulus to an object
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function stimulus($param,$fields) {
|
|
||||||
|
|
||||||
|
|
||||||
$params['operation'] = 'core/apply_stimulus';
|
|
||||||
|
|
||||||
$params['comment'] = $param['comment'];
|
|
||||||
|
|
||||||
$params['stimulus'] = $param['stimulus'];
|
|
||||||
|
|
||||||
$params['class'] = $param['class'];
|
|
||||||
|
|
||||||
$params['key'] = $param['key'];
|
|
||||||
|
|
||||||
$params['fields'] = $fields;
|
|
||||||
|
|
||||||
|
|
||||||
$execute = $this->execute($params);
|
|
||||||
|
|
||||||
|
|
||||||
RETURN $execute;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Hit data to itop server
|
|
||||||
|
|
||||||
private function execute($params) {
|
|
||||||
|
|
||||||
|
|
||||||
$param['auth_user'] = $this->itopApi['user'];
|
|
||||||
|
|
||||||
$param['auth_pwd'] = $this->itopApi['pass'];
|
|
||||||
|
|
||||||
$param['json_data'] = json_encode($params);
|
|
||||||
|
|
||||||
|
|
||||||
$ch = curl_init();
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $this->itopApi['url']);
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_POST, count($param));
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param));
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
|
|
||||||
$result = json_decode(curl_exec($ch),true);
|
|
||||||
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
|
|
||||||
RETURN $result; // Returning data on array format
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Testing purpose function
|
|
||||||
|
|
||||||
|
|
||||||
public function test() {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo $this->itopApi['url'];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"operation":"core/create",
|
|
||||||
"comment":"Synchronization from blah...",
|
|
||||||
"class":"RoutineChange",
|
|
||||||
"fields":
|
|
||||||
{
|
|
||||||
"org_id":"SELECT Organization WHERE name = 'ALLDCS'",
|
|
||||||
"caller_id":{"name":"Krings","first_name":"Allard"},
|
|
||||||
"title":"container",
|
|
||||||
"description":"container gebouwd"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
curl -X POST -F 'version=1.3' -F 'auth_user=allard' -F 'auth_pwd=Itop01@@@' http://itop.alldcs.nl/webservices/rest.php -F 'json_data=@./change.json'
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM ubuntu
|
|
||||||
RUN apt update && apt upgrade -y
|
|
||||||
RUN apt install wget -y
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
php webservices/import.php --auth_user=login --auth_pwd=password --csvfile="location.csv"
|
|
||||||
--charset="UTF-8" --no_localize=1 --class="Location" --reconcialiationkeys="name,org_id->name"
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class itopApi {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define API details
|
|
||||||
|
|
||||||
public function __construct() {
|
|
||||||
|
|
||||||
$this->itopApi = array(
|
|
||||||
|
|
||||||
"url" => "http://itop.alldcs.nl",
|
|
||||||
|
|
||||||
"user" => "allard",
|
|
||||||
|
|
||||||
"pass" => "Itop01@"
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Get details function
|
|
||||||
|
|
||||||
|
|
||||||
public function get($class,$key) {
|
|
||||||
|
|
||||||
|
|
||||||
$params['operation'] = 'core/get';
|
|
||||||
|
|
||||||
$params['class'] = $class;
|
|
||||||
|
|
||||||
$params['key'] = $key;
|
|
||||||
|
|
||||||
|
|
||||||
$execute = $this->execute($params);
|
|
||||||
|
|
||||||
RETURN $execute;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Apply stimulus to an object
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function stimulus($param,$fields) {
|
|
||||||
|
|
||||||
|
|
||||||
$params['operation'] = 'core/apply_stimulus';
|
|
||||||
|
|
||||||
$params['comment'] = $param['comment'];
|
|
||||||
|
|
||||||
$params['stimulus'] = $param['stimulus'];
|
|
||||||
|
|
||||||
$params['class'] = $param['class'];
|
|
||||||
|
|
||||||
$params['key'] = $param['key'];
|
|
||||||
|
|
||||||
$params['fields'] = $fields;
|
|
||||||
|
|
||||||
|
|
||||||
$execute = $this->execute($params);
|
|
||||||
|
|
||||||
|
|
||||||
RETURN $execute;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Hit data to itop server
|
|
||||||
|
|
||||||
private function execute($params) {
|
|
||||||
|
|
||||||
|
|
||||||
$param['auth_user'] = $this->itopApi['user'];
|
|
||||||
|
|
||||||
$param['auth_pwd'] = $this->itopApi['pass'];
|
|
||||||
|
|
||||||
$param['json_data'] = json_encode($params);
|
|
||||||
|
|
||||||
|
|
||||||
$ch = curl_init();
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $this->itopApi['url']);
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_POST, count($param));
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($param));
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
|
|
||||||
$result = json_decode(curl_exec($ch),true);
|
|
||||||
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
|
|
||||||
RETURN $result; // Returning data on array format
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Testing purpose function
|
|
||||||
|
|
||||||
|
|
||||||
public function test() {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo $this->itopApi['url'];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"operation":"core/create",
|
|
||||||
"comment":"Synchronization from blah...",
|
|
||||||
"class":"RoutineChange",
|
|
||||||
"fields":
|
|
||||||
{
|
|
||||||
"org_id":"SELECT Organization WHERE name = 'ALLDCS'",
|
|
||||||
"caller_id":{"name":"Krings","first_name":"Allard"},
|
|
||||||
"title":"container",
|
|
||||||
"description":"container gebouwd"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
##################################################################################
|
|
||||||
# #
|
|
||||||
# Example script for creating a UserRequest ticket via the REST/JSON webservices #
|
|
||||||
# #
|
|
||||||
##################################################################################
|
|
||||||
|
|
||||||
# iTop location and credentials, change them to suit your iTop installation
|
|
||||||
ITOP_URL="https://itop.alldcs.nl"
|
|
||||||
ITOP_USER="allard"
|
|
||||||
ITOP_PWD="Itop01@@@"
|
|
||||||
ORGANIZATION="0001"
|
|
||||||
TITLE="UserRequest"
|
|
||||||
DESCRIPTION="Container created"
|
|
||||||
CALLER="0001"
|
|
||||||
COMMENT="commentaar"
|
|
||||||
CHANGE="RoutineChange"
|
|
||||||
# Let's create the ticket via the REST/JSON API
|
|
||||||
JSON_DATA='{"operation":"core/create", "class":"'"${CHANGE}"'", "fields": {"org_id":"'"${ORGANIZATION}"'", "title":"'"$TITLE"'", "description":"'"$DESCRIPTION"'"}, "caller": "'"$CALLER"'", "comment": "'"$COMMENT"'"}'
|
|
||||||
RESULT=`wget -q --post-data='auth_user='"${ITOP_USER}"'&auth_pwd='"${ITOP_PWD}"'&json_data='"${JSON_DATA}" --no-check-certificate -O - "${ITOP_URL}/webservices/rest.php?version=1.0"`
|
|
||||||
#PATTERN='"key":"([0-9])+"'
|
|
||||||
#if [[ $RESULT =~ $PATTERN ]]; then
|
|
||||||
# echo "Change created successfully"
|
|
||||||
# else
|
|
||||||
# echo "ERROR: failed to create change"
|
|
||||||
# echo $RESULT
|
|
||||||
#fi
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
curl -X POST -F 'version=1.3' -F 'auth_user=allard' -F 'auth_pwd=Itop01@@@' http://itop.alldcs.nl/webservices/rest.php -F 'json_data=@./change.json'
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"operation":"core/create",
|
|
||||||
"comment":"Synchronization from blah...",
|
|
||||||
"class":"UserRequest",
|
|
||||||
"output_fields":"id, friendlyname",
|
|
||||||
"fields":
|
|
||||||
{
|
|
||||||
"org_id":"SELECT Organization WHERE name = 'ALLDCS'",
|
|
||||||
"caller_id":{"name":"Krings","first_name":"Allard"},
|
|
||||||
"title":"issue blah",
|
|
||||||
"description":"something happened"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Last Name,Status,Organization->Name,Email,Phone,Notification,Function,First Name
|
|
||||||
"Monet","Active","Demo","monet@demo.com","","yes","","Claude"
|
|
||||||
"Flaubert","Active","IT Department","flaubert@it.com","","yes","","Gustave"
|
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
##################################################################################
|
|
||||||
# #
|
|
||||||
# Example script for creating a UserRequest ticket via the REST/JSON webservices #
|
|
||||||
# #
|
|
||||||
##################################################################################
|
|
||||||
|
|
||||||
# iTop location and credentials, change them to suit your iTop installation
|
|
||||||
ITOP_URL="https://itop.alldcs.nl"
|
|
||||||
ITOP_USER="allard"
|
|
||||||
ITOP_PWD="Itop01@@@"
|
|
||||||
|
|
||||||
|
|
||||||
# Parameters checking, see below for default values
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
echo "Missing parameter 1: host"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
HOST="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$2" == "" ]; then
|
|
||||||
echo "Missing parameter 2: Service"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE="$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$3" == "" ]; then
|
|
||||||
echo "Missing parameter 3: Service Status"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE_STATUS="$3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$4" == "" ]; then
|
|
||||||
echo "Missing parameter 4: Service State Type"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE_STATUS_TYPE="$4"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Default values, adapt them to your configuration
|
|
||||||
TICKET_CLASS="UserRequest"
|
|
||||||
ORGANIZATION="SELECT Organization JOIN FunctionalCI AS CI ON CI.org_id=Organization.id WHERE CI.name='"${HOST}"'"
|
|
||||||
TITLE="Service Down on $1"
|
|
||||||
DESCRIPTION="The service $SERVICE is in state $SERVICE_STATUS on $HOST"
|
|
||||||
|
|
||||||
# Let's create the ticket via the REST/JSON API
|
|
||||||
if [[ ( "$SERVICE_STATUS" != "OK" ) && ( "$SERVICE_STATUS" != "UP" ) && ( "$SERVICE_STATUS_TYPE" == "HARD" ) ]]; then
|
|
||||||
CIS_LIST='[{"functionalci_id":"SELECT FunctionalCI WHERE name=\"'"$1"'\"", "impact_code": "manual"}]'
|
|
||||||
JSON_DATA='{"operation":"core/create", "class":"'"${TICKET_CLASS}"'", "fields": {"functionalcis_list":'"${CIS_LIST}"', "org_id":"'"${ORGANIZATION}"'", "title":"'"$TITLE"'", "description":"'"$DESCRIPTION"'"}, "comment": "Created by the Monitoring", "output_fields": "id"}'
|
|
||||||
|
|
||||||
RESULT=`wget -q --post-data='auth_user='"${ITOP_USER}"'&auth_pwd='"${ITOP_PWD}"'&json_data='"${JSON_DATA}" --no-check-certificate -O - "${ITOP_URL}/webservices/rest.php?version=1.0"`
|
|
||||||
|
|
||||||
PATTERN='"key":"([0-9])+"'
|
|
||||||
if [[ $RESULT =~ $PATTERN ]]; then
|
|
||||||
echo "Ticket created successfully"
|
|
||||||
else
|
|
||||||
echo "ERROR: failed to create ticket"
|
|
||||||
echo $RESULT
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Service State Type != HARD, doing nothing"
|
|
||||||
fi
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
HTTP POST itop.alldcs.nl/webservices/rest.php?version=1.3
|
|
||||||
auth_user=Itop_admin
|
|
||||||
auth_pwd=Itop01@
|
|
||||||
json_data=
|
|
||||||
{
|
|
||||||
"operation": "list_operations"
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include('apifunction.php');
|
|
||||||
|
|
||||||
$itopApi = new itopApi;
|
|
||||||
|
|
||||||
/** GET Function Test **/
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
$api = $itopApi->get("Incident","1620");
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>";
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
/** ASSIGN (Stimulus) Function Test **/
|
|
||||||
|
|
||||||
/* $param['comment'] = "Assigned from API";
|
|
||||||
|
|
||||||
$param['stimulus'] = "ev_assign";
|
|
||||||
|
|
||||||
$param['class'] = "Incident";
|
|
||||||
|
|
||||||
$param['key'] = "1620";
|
|
||||||
|
|
||||||
$fields['team_id'] = "39";
|
|
||||||
|
|
||||||
$fields['agent_id'] = "3";
|
|
||||||
|
|
||||||
$api = $itopApi->stimulus($param,$fields);
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>"; */
|
|
||||||
|
|
||||||
|
|
||||||
/** RESOLVE (Stimulus) Function Test **/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* $param['comment'] = "Resolved from API";
|
|
||||||
|
|
||||||
$param['stimulus'] = "ev_resolve";
|
|
||||||
|
|
||||||
$param['class'] = "Incident";
|
|
||||||
|
|
||||||
$param['key'] = "1653";
|
|
||||||
|
|
||||||
$fields['solution'] = "PC Sudah terinstall iReap";
|
|
||||||
|
|
||||||
|
|
||||||
$api = $itopApi->stimulus($param,$fields);
|
|
||||||
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>"; */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"operation":"core/create",
|
|
||||||
"comment":"Synchronization from blah...",
|
|
||||||
"class":"UserRequest",
|
|
||||||
"output_fields":"id, friendlyname",
|
|
||||||
"fields":
|
|
||||||
{
|
|
||||||
"org_id":"SELECT Organization WHERE name = 'ALLDCS'",
|
|
||||||
"caller_id":{"name":"Krings","first_name":"Allard"},
|
|
||||||
"title":"issue blah",
|
|
||||||
"description":"something happened"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
Last Name,Status,Organization->Name,Email,Phone,Notification,Function,First Name
|
|
||||||
"Monet","Active","Demo","monet@demo.com","","yes","","Claude"
|
|
||||||
"Flaubert","Active","IT Department","flaubert@it.com","","yes","","Gustave"
|
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
##################################################################################
|
|
||||||
# #
|
|
||||||
# Example script for creating a UserRequest ticket via the REST/JSON webservices #
|
|
||||||
# #
|
|
||||||
##################################################################################
|
|
||||||
|
|
||||||
# iTop location and credentials, change them to suit your iTop installation
|
|
||||||
ITOP_URL="https://itop.alldcs.nl"
|
|
||||||
ITOP_USER="allard"
|
|
||||||
ITOP_PWD="Itop01@@@"
|
|
||||||
|
|
||||||
|
|
||||||
# Parameters checking, see below for default values
|
|
||||||
if [ "$1" == "" ]; then
|
|
||||||
echo "Missing parameter 1: host"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
HOST="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$2" == "" ]; then
|
|
||||||
echo "Missing parameter 2: Service"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE="$2"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$3" == "" ]; then
|
|
||||||
echo "Missing parameter 3: Service Status"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE_STATUS="$3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$4" == "" ]; then
|
|
||||||
echo "Missing parameter 4: Service State Type"
|
|
||||||
exit -1
|
|
||||||
else
|
|
||||||
SERVICE_STATUS_TYPE="$4"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Default values, adapt them to your configuration
|
|
||||||
TICKET_CLASS="UserRequest"
|
|
||||||
ORGANIZATION="SELECT Organization JOIN FunctionalCI AS CI ON CI.org_id=Organization.id WHERE CI.name='"${HOST}"'"
|
|
||||||
TITLE="Service Down on $1"
|
|
||||||
DESCRIPTION="The service $SERVICE is in state $SERVICE_STATUS on $HOST"
|
|
||||||
|
|
||||||
# Let's create the ticket via the REST/JSON API
|
|
||||||
if [[ ( "$SERVICE_STATUS" != "OK" ) && ( "$SERVICE_STATUS" != "UP" ) && ( "$SERVICE_STATUS_TYPE" == "HARD" ) ]]; then
|
|
||||||
CIS_LIST='[{"functionalci_id":"SELECT FunctionalCI WHERE name=\"'"$1"'\"", "impact_code": "manual"}]'
|
|
||||||
JSON_DATA='{"operation":"core/create", "class":"'"${TICKET_CLASS}"'", "fields": {"functionalcis_list":'"${CIS_LIST}"', "org_id":"'"${ORGANIZATION}"'", "title":"'"$TITLE"'", "description":"'"$DESCRIPTION"'"}, "comment": "Created by the Monitoring", "output_fields": "id"}'
|
|
||||||
|
|
||||||
RESULT=`wget -q --post-data='auth_user='"${ITOP_USER}"'&auth_pwd='"${ITOP_PWD}"'&json_data='"${JSON_DATA}" --no-check-certificate -O - "${ITOP_URL}/webservices/rest.php?version=1.0"`
|
|
||||||
|
|
||||||
PATTERN='"key":"([0-9])+"'
|
|
||||||
if [[ $RESULT =~ $PATTERN ]]; then
|
|
||||||
echo "Ticket created successfully"
|
|
||||||
else
|
|
||||||
echo "ERROR: failed to create ticket"
|
|
||||||
echo $RESULT
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Service State Type != HARD, doing nothing"
|
|
||||||
fi
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
HTTP POST itop.alldcs.nl/webservices/rest.php?version=1.3
|
|
||||||
auth_user=Itop_admin
|
|
||||||
auth_pwd=Itop01@
|
|
||||||
json_data=
|
|
||||||
{
|
|
||||||
"operation": "list_operations"
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include('apifunction.php');
|
|
||||||
|
|
||||||
$itopApi = new itopApi;
|
|
||||||
|
|
||||||
/** GET Function Test **/
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
$api = $itopApi->get("Incident","1620");
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>";
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
/** ASSIGN (Stimulus) Function Test **/
|
|
||||||
|
|
||||||
/* $param['comment'] = "Assigned from API";
|
|
||||||
|
|
||||||
$param['stimulus'] = "ev_assign";
|
|
||||||
|
|
||||||
$param['class'] = "Incident";
|
|
||||||
|
|
||||||
$param['key'] = "1620";
|
|
||||||
|
|
||||||
$fields['team_id'] = "39";
|
|
||||||
|
|
||||||
$fields['agent_id'] = "3";
|
|
||||||
|
|
||||||
$api = $itopApi->stimulus($param,$fields);
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>"; */
|
|
||||||
|
|
||||||
|
|
||||||
/** RESOLVE (Stimulus) Function Test **/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* $param['comment'] = "Resolved from API";
|
|
||||||
|
|
||||||
$param['stimulus'] = "ev_resolve";
|
|
||||||
|
|
||||||
$param['class'] = "Incident";
|
|
||||||
|
|
||||||
$param['key'] = "1653";
|
|
||||||
|
|
||||||
$fields['solution'] = "PC Sudah terinstall iReap";
|
|
||||||
|
|
||||||
|
|
||||||
$api = $itopApi->stimulus($param,$fields);
|
|
||||||
|
|
||||||
|
|
||||||
echo "<pre>";
|
|
||||||
|
|
||||||
print_r($api);
|
|
||||||
|
|
||||||
echo "</pre>"; */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
+47
-54
@@ -1,44 +1,8 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolume
|
|
||||||
metadata:
|
|
||||||
name: itop-pv
|
|
||||||
spec:
|
|
||||||
storageClassName: ""
|
|
||||||
capacity:
|
|
||||||
storage: 1Gi
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteMany
|
|
||||||
persistentVolumeReclaimPolicy: Retain
|
|
||||||
mountOptions:
|
|
||||||
- hard
|
|
||||||
- nfsvers=4.1
|
|
||||||
nfs:
|
|
||||||
server: 192.168.2.110
|
|
||||||
path: /mnt/nfs_share/itop/
|
|
||||||
readOnly: false
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: itop-pvc
|
|
||||||
namespace: itop
|
|
||||||
spec:
|
|
||||||
storageClassName: ""
|
|
||||||
volumeName: itop-pv
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteMany
|
|
||||||
volumeMode: Filesystem
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 1Gi
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: itop
|
name: itop
|
||||||
namespace: itop
|
namespace: itop
|
||||||
labels:
|
|
||||||
app: itop
|
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
@@ -49,26 +13,55 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: itop
|
app: itop
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 33 # ensures www-data can write to volumes
|
||||||
containers:
|
containers:
|
||||||
- name: itop
|
- name: itop
|
||||||
image: allardkrings/itop:external
|
image: vbkunin/itop:latest
|
||||||
env:
|
imagePullPolicy: Always
|
||||||
- name: ITOP_DB_HOST
|
ports:
|
||||||
value: mariadb.mariadb
|
- containerPort: 80
|
||||||
- name: ITOP_DB_NAME
|
env:
|
||||||
value: itop
|
- name: ITOP_DB_HOST
|
||||||
- name: ITOP_DB_USER
|
value: mariadb.mariadb
|
||||||
value: itop
|
- name: ITOP_DB_NAME
|
||||||
- name: ITOP_DB_PASS
|
value: itop
|
||||||
value: itop
|
- name: ITOP_DB_USER
|
||||||
volumeMounts:
|
value: itop
|
||||||
- mountPath: /var/www/html/conf
|
- name: ITOP_DB_PASS
|
||||||
name: itop
|
value: itop
|
||||||
subPath: conf
|
volumeMounts:
|
||||||
|
- name: conf
|
||||||
|
mountPath: /var/www/html/conf
|
||||||
|
- name: env-production
|
||||||
|
mountPath: /var/www/html/env-production
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/www/html/data
|
||||||
|
- name: log
|
||||||
|
mountPath: /var/www/html/log
|
||||||
|
- name: extensions
|
||||||
|
mountPath: /var/www/html/extensions
|
||||||
|
- name: apache2-logs
|
||||||
|
mountPath: /var/log/apache2
|
||||||
volumes:
|
volumes:
|
||||||
- name: itop
|
- name: conf
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: itop-pvc
|
claimName: itop-conf-pvc
|
||||||
|
- name: env-production
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-env-pvc
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-data-pvc
|
||||||
|
- name: log
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-log-pvc
|
||||||
|
- name: extensions
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-extensions-pvc
|
||||||
|
- name: apache2-logs
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: itop-apache2-logs-pvc
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
Executable
+183
@@ -0,0 +1,183 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-conf
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
mountOptions:
|
||||||
|
- hard
|
||||||
|
- nfsvers=4.1
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/conf
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-conf-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-conf
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-env
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/env-production
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-env-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-env
|
||||||
|
volumeMode: Filesystem
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-data
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 5Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/data
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-data-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-data
|
||||||
|
volumeMode: Filesystem
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-log
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/log
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-log-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-log
|
||||||
|
volumeMode: Filesystem
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-extensions
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/extensions
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-extensions-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-extensions
|
||||||
|
volumeMode: Filesystem
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: pv-itop-apache2-logs
|
||||||
|
spec:
|
||||||
|
storageClassName: ""
|
||||||
|
capacity:
|
||||||
|
storage: 1Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
nfs:
|
||||||
|
server: 192.168.2.110
|
||||||
|
path: /mnt/nfs_share/itop/apache2-logs
|
||||||
|
readOnly: false
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: itop-apache2-logs-pvc
|
||||||
|
namespace: itop
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteMany
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: ""
|
||||||
|
volumeName: pv-itop-apache2-logs
|
||||||
|
volumeMode: Filesystem
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
HTTP POST itop.alldcs.nl/webservices/rest.php?version=1.3
|
|
||||||
auth_user=Itop_admin
|
|
||||||
auth_pwd=Itop01@
|
|
||||||
json_data=
|
|
||||||
{
|
|
||||||
"operation": "list_operations"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
User: root
|
||||||
|
Password: jamesbrown
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
ITOP_URL="https://itop-dev.allarddcs.nl"
|
||||||
|
ITOP_USER="tekton"
|
||||||
|
ITOP_PWD="Itop01@@@"
|
||||||
|
ORGANIZATION="0001"
|
||||||
|
TITLE="Containerchange"
|
||||||
|
DESCRIPTION="Container created"
|
||||||
|
CALLER="0001"
|
||||||
|
COMMENT="new version of container olproperties has been pushed"
|
||||||
|
CHANGE="RoutineChange"
|
||||||
|
|
||||||
|
JSON_DATA=$(jq -c <<EOF
|
||||||
|
{
|
||||||
|
"operation": "core/create",
|
||||||
|
"class": "${CHANGE}",
|
||||||
|
"fields": {
|
||||||
|
"org_id": "${ORGANIZATION}",
|
||||||
|
"title": "${TITLE}",
|
||||||
|
"description": "${DESCRIPTION}"
|
||||||
|
},
|
||||||
|
"caller": "${CALLER}",
|
||||||
|
"comment": "${COMMENT}"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "=== DEBUG: JSON payload (compact) ==="
|
||||||
|
echo "$JSON_DATA"
|
||||||
|
echo "====================================="
|
||||||
|
|
||||||
|
POST_DATA=$(printf \
|
||||||
|
'auth_user=%s&auth_pwd=%s&json_data=%s' \
|
||||||
|
"$ITOP_USER" \
|
||||||
|
"$ITOP_PWD" \
|
||||||
|
"$(printf '%s' "$JSON_DATA" | jq -sRr @uri)"
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "=== DEBUG: POST data (URL-encoded) ==="
|
||||||
|
echo "$POST_DATA"
|
||||||
|
echo "====================================="
|
||||||
|
|
||||||
|
echo "=== DEBUG: Sending request to iTop ==="
|
||||||
|
|
||||||
|
HTTP_RESPONSE=$(wget \
|
||||||
|
--timeout=15 \
|
||||||
|
--tries=1 \
|
||||||
|
--server-response \
|
||||||
|
--no-check-certificate \
|
||||||
|
--header="Content-Type: application/x-www-form-urlencoded" \
|
||||||
|
--post-data="$POST_DATA" \
|
||||||
|
-O - \
|
||||||
|
"${ITOP_URL}/webservices/rest.php?version=1.0" 2>&1)
|
||||||
|
|
||||||
|
WGET_RC=$?
|
||||||
|
|
||||||
|
echo "=== DEBUG: wget exit code ==="
|
||||||
|
echo "$WGET_RC"
|
||||||
|
|
||||||
|
echo "=== DEBUG: Raw response ==="
|
||||||
|
echo "$HTTP_RESPONSE"
|
||||||
|
echo "==========================="
|
||||||
|
|
||||||
|
JSON_BODY=$(echo "$HTTP_RESPONSE" | sed -n '/^{/,$p')
|
||||||
|
|
||||||
|
if [[ -z "$JSON_BODY" ]]; then
|
||||||
|
echo "ERROR: No JSON returned from iTop"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== DEBUG: Parsed JSON ==="
|
||||||
|
echo "$JSON_BODY" | jq .
|
||||||
|
echo "=========================="
|
||||||
|
|
||||||
|
CODE=$(echo "$JSON_BODY" | jq -r '.code // -1')
|
||||||
|
MESSAGE=$(echo "$JSON_BODY" | jq -r '.message // empty')
|
||||||
|
|
||||||
|
if [[ "$CODE" == "0" ]]; then
|
||||||
|
KEY=$(echo "$JSON_BODY" | jq -r '.objects[].key')
|
||||||
|
echo "SUCCESS: Change created, key=$KEY"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "ERROR: iTop rejected the request"
|
||||||
|
echo "Code : $CODE"
|
||||||
|
echo "Message: $MESSAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1
|
apiVersion: tekton.dev/v1beta1 # or tekton.dev/v1beta1
|
||||||
kind: Task
|
kind: Task
|
||||||
metadata:
|
metadata:
|
||||||
name: register-change
|
name: register-change
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ITOP_URL="http://itop.alldcs.nl"
|
ITOP_URL="https://itop-dev.allarddcs.nl"
|
||||||
ITOP_USER="tekton"
|
ITOP_USER="tekton"
|
||||||
ITOP_PWD="Itop01@@@"
|
ITOP_PWD="Itop01@@@"
|
||||||
ORGANIZATION="0001"
|
ORGANIZATION="0001"
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: cert-manager.io/v1
|
||||||
|
kind: Certificate
|
||||||
|
metadata:
|
||||||
|
name: hookshot-lp.allarddcs.nl-tls
|
||||||
|
namespace: matrix
|
||||||
|
spec:
|
||||||
|
dnsNames:
|
||||||
|
- hookshot-lp.allarddcs.nl
|
||||||
|
issuerRef:
|
||||||
|
group: cert-manager.io
|
||||||
|
kind: ClusterIssuer
|
||||||
|
name: letsencrypt
|
||||||
|
secretName: hookshot.allarddcs.nl-tls
|
||||||
|
usages:
|
||||||
|
- digital signature
|
||||||
|
- key encipherment
|
||||||
+17
-2
@@ -84,7 +84,22 @@ spec:
|
|||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: matrix-hookshot
|
name: matrix-hookshot-http
|
||||||
|
namespace: matrix
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- web
|
||||||
|
routes:
|
||||||
|
- match: Host(`hookshot-lp.allarddcs.nl`) && PathPrefix(`/webhook`)
|
||||||
|
kind: Rule
|
||||||
|
services:
|
||||||
|
- name: matrix-hookshot
|
||||||
|
port: 9000
|
||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRoute
|
||||||
|
metadata:
|
||||||
|
name: matrix-hookshot-tls
|
||||||
namespace: matrix
|
namespace: matrix
|
||||||
spec:
|
spec:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
@@ -96,7 +111,7 @@ spec:
|
|||||||
- name: matrix-hookshot
|
- name: matrix-hookshot
|
||||||
port: 9000
|
port: 9000
|
||||||
tls:
|
tls:
|
||||||
certResolver: default
|
secretName: hookshot.allarddcs.nl-tls
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolume
|
kind: PersistentVolume
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ spec:
|
|||||||
port: 8008
|
port: 8008
|
||||||
tls:
|
tls:
|
||||||
secretName: matrix-lp.allarddcs.nl-tls
|
secretName: matrix-lp.allarddcs.nl-tls
|
||||||
# certResolver: letsencrypt
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolume
|
kind: PersistentVolume
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
Dit is een catalogus van alle yamls en values die gebruikt worden in de clusters van Allard
|
User : Admin
|
||||||
|
passord: zabbix
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user