diff --git a/README.md b/README.md index df013bf..15b3b04 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ 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 + diff --git a/dev/backstage/catalog-info.old b/dev/backstage/catalog-info.old new file mode 100644 index 0000000..5cc7d90 --- /dev/null +++ b/dev/backstage/catalog-info.old @@ -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 diff --git a/dev/backstage/catalog-info.yaml b/dev/backstage/catalog-info.yaml index 5cc7d90..8a1b4bc 100644 --- a/dev/backstage/catalog-info.yaml +++ b/dev/backstage/catalog-info.yaml @@ -7,12 +7,10 @@ metadata: annotations: backstage.io/kubernetes-id: backstage argocd.argoproj.io/ignore-differences: "true" - backstage.io/techdocs-ref: dir:. + backstage.io/techdocs-ref: dir:. # points to root links: - - url: https://github.com/AllardKrings/kubernetes/dev/backstage + - url: https://github.com/AllardKrings/kubernetes title: backstage-configuratie - docs: - - url: ./README.md spec: type: service lifecycle: production diff --git a/dev/backstage/mkdocs.yml b/dev/backstage/mkdocs.yml new file mode 100644 index 0000000..45d5cd4 --- /dev/null +++ b/dev/backstage/mkdocs.yml @@ -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 diff --git a/dev/catalog-info.yaml.ignore b/dev/catalog-info.yaml.ignore deleted file mode 100644 index cdbb3d8..0000000 --- a/dev/catalog-info.yaml.ignore +++ /dev/null @@ -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 - diff --git a/dev/itop/README.md b/dev/itop/README.md deleted file mode 100755 index 8438547..0000000 --- a/dev/itop/README.md +++ /dev/null @@ -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 diff --git a/dev/itop/catalog-info.yaml b/dev/itop/catalog-info.yaml deleted file mode 100644 index 086088c..0000000 --- a/dev/itop/catalog-info.yaml +++ /dev/null @@ -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 - diff --git a/dev/itop/itop-integrations/create-change.sh b/dev/itop/create-change.sh similarity index 83% rename from dev/itop/itop-integrations/create-change.sh rename to dev/itop/create-change.sh index abd076e..7cb56df 100755 --- a/dev/itop/itop-integrations/create-change.sh +++ b/dev/itop/create-change.sh @@ -2,15 +2,14 @@ ################################################################################## # # # 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="tekton" -ITOP_PWD="Itop01@@@" -ORGANIZATION="0002" -TITLE="Change registration" +################################################################################## +ITOP_URL="https://itop-dev.allarddcs.nl" +ITOP_USER="admin" +ITOP_PWD="Itop01@" +ORGANIZATION="0001" +TITLE="UserRequest" DESCRIPTION="Container created" CALLER="0001" COMMENT="commentaar" @@ -21,8 +20,8 @@ RESULT=`wget -q --post-data='auth_user='"${ITOP_USER}"'&auth_pwd='"${ITOP_PWD}"' PATTERN='"key":"([0-9])+"' if [[ $RESULT =~ $PATTERN ]]; then echo "Change created successfully" + echo $RESULT else echo "ERROR: failed to create change" echo $RESULT - exit 1 fi diff --git a/dev/itop/cron.yaml b/dev/itop/cron.yaml new file mode 100644 index 0000000..0876fc5 --- /dev/null +++ b/dev/itop/cron.yaml @@ -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 diff --git a/dev/itop/itop-integrations/Dockerfile b/dev/itop/itop-integrations/Dockerfile deleted file mode 100755 index 849b478..0000000 --- a/dev/itop/itop-integrations/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM ubuntu -RUN apt update && apt upgrade -y -RUN apt install wget -y diff --git a/dev/itop/itop-integrations/add-person.sh b/dev/itop/itop-integrations/add-person.sh deleted file mode 100755 index e093ab0..0000000 --- a/dev/itop/itop-integrations/add-person.sh +++ /dev/null @@ -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" diff --git a/dev/itop/itop-integrations/apifunction.php b/dev/itop/itop-integrations/apifunction.php deleted file mode 100755 index 574d51d..0000000 --- a/dev/itop/itop-integrations/apifunction.php +++ /dev/null @@ -1,135 +0,0 @@ -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']; - - - - } - - - -} - - - - - -?> diff --git a/dev/itop/itop-integrations/change.json b/dev/itop/itop-integrations/change.json deleted file mode 100755 index 4230b3d..0000000 --- a/dev/itop/itop-integrations/change.json +++ /dev/null @@ -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" - } -} diff --git a/dev/itop/itop-integrations/curl.sh b/dev/itop/itop-integrations/curl.sh deleted file mode 100755 index a9a2fb7..0000000 --- a/dev/itop/itop-integrations/curl.sh +++ /dev/null @@ -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' diff --git a/dev/itop/itop-integrations/itop-integrations/Dockerfile b/dev/itop/itop-integrations/itop-integrations/Dockerfile deleted file mode 100755 index 849b478..0000000 --- a/dev/itop/itop-integrations/itop-integrations/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM ubuntu -RUN apt update && apt upgrade -y -RUN apt install wget -y diff --git a/dev/itop/itop-integrations/itop-integrations/add-person.sh b/dev/itop/itop-integrations/itop-integrations/add-person.sh deleted file mode 100755 index e093ab0..0000000 --- a/dev/itop/itop-integrations/itop-integrations/add-person.sh +++ /dev/null @@ -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" diff --git a/dev/itop/itop-integrations/itop-integrations/apifunction.php b/dev/itop/itop-integrations/itop-integrations/apifunction.php deleted file mode 100755 index 574d51d..0000000 --- a/dev/itop/itop-integrations/itop-integrations/apifunction.php +++ /dev/null @@ -1,135 +0,0 @@ -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']; - - - - } - - - -} - - - - - -?> diff --git a/dev/itop/itop-integrations/itop-integrations/change.json b/dev/itop/itop-integrations/itop-integrations/change.json deleted file mode 100755 index 4230b3d..0000000 --- a/dev/itop/itop-integrations/itop-integrations/change.json +++ /dev/null @@ -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" - } -} diff --git a/dev/itop/itop-integrations/itop-integrations/create-change.sh b/dev/itop/itop-integrations/itop-integrations/create-change.sh deleted file mode 100755 index db8e471..0000000 --- a/dev/itop/itop-integrations/itop-integrations/create-change.sh +++ /dev/null @@ -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 diff --git a/dev/itop/itop-integrations/itop-integrations/curl.sh b/dev/itop/itop-integrations/itop-integrations/curl.sh deleted file mode 100755 index a9a2fb7..0000000 --- a/dev/itop/itop-integrations/itop-integrations/curl.sh +++ /dev/null @@ -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' diff --git a/dev/itop/itop-integrations/itop-integrations/my-json-operation.json b/dev/itop/itop-integrations/itop-integrations/my-json-operation.json deleted file mode 100755 index 5f313e9..0000000 --- a/dev/itop/itop-integrations/itop-integrations/my-json-operation.json +++ /dev/null @@ -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" - } -} diff --git a/dev/itop/itop-integrations/itop-integrations/person.csv b/dev/itop/itop-integrations/itop-integrations/person.csv deleted file mode 100755 index 863985b..0000000 --- a/dev/itop/itop-integrations/itop-integrations/person.csv +++ /dev/null @@ -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" diff --git a/dev/itop/itop-integrations/itop-integrations/test-json.sh b/dev/itop/itop-integrations/itop-integrations/test-json.sh deleted file mode 100755 index e979934..0000000 --- a/dev/itop/itop-integrations/itop-integrations/test-json.sh +++ /dev/null @@ -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 diff --git a/dev/itop/itop-integrations/itop-integrations/test.sh b/dev/itop/itop-integrations/itop-integrations/test.sh deleted file mode 100755 index e1e9d60..0000000 --- a/dev/itop/itop-integrations/itop-integrations/test.sh +++ /dev/null @@ -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" -} diff --git a/dev/itop/itop-integrations/itop-integrations/tester.php b/dev/itop/itop-integrations/itop-integrations/tester.php deleted file mode 100755 index 8cdd310..0000000 --- a/dev/itop/itop-integrations/itop-integrations/tester.php +++ /dev/null @@ -1,73 +0,0 @@ -get("Incident","1620"); - - echo "
";
-
-	print_r($api);
-
-	echo "
"; - - **/ - - -/** 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 "
";
-
-	print_r($api);
-
-	echo "
"; */ - - -/** 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 "
";
-
-	print_r($api);
-
-	echo "
"; */ - - - -?> diff --git a/dev/itop/itop-integrations/my-json-operation.json b/dev/itop/itop-integrations/my-json-operation.json deleted file mode 100755 index 5f313e9..0000000 --- a/dev/itop/itop-integrations/my-json-operation.json +++ /dev/null @@ -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" - } -} diff --git a/dev/itop/itop-integrations/person.csv b/dev/itop/itop-integrations/person.csv deleted file mode 100755 index 863985b..0000000 --- a/dev/itop/itop-integrations/person.csv +++ /dev/null @@ -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" diff --git a/dev/itop/itop-integrations/test-json.sh b/dev/itop/itop-integrations/test-json.sh deleted file mode 100755 index e979934..0000000 --- a/dev/itop/itop-integrations/test-json.sh +++ /dev/null @@ -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 diff --git a/dev/itop/itop-integrations/test.sh b/dev/itop/itop-integrations/test.sh deleted file mode 100755 index e1e9d60..0000000 --- a/dev/itop/itop-integrations/test.sh +++ /dev/null @@ -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" -} diff --git a/dev/itop/itop-integrations/tester.php b/dev/itop/itop-integrations/tester.php deleted file mode 100755 index 8cdd310..0000000 --- a/dev/itop/itop-integrations/tester.php +++ /dev/null @@ -1,73 +0,0 @@ -get("Incident","1620"); - - echo "
";
-
-	print_r($api);
-
-	echo "
"; - - **/ - - -/** 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 "
";
-
-	print_r($api);
-
-	echo "
"; */ - - -/** 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 "
";
-
-	print_r($api);
-
-	echo "
"; */ - - - -?> diff --git a/dev/itop/itop.yaml b/dev/itop/itop.yaml index f012ba7..c35c22e 100755 --- a/dev/itop/itop.yaml +++ b/dev/itop/itop.yaml @@ -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 kind: Deployment metadata: name: itop namespace: itop - labels: - app: itop spec: replicas: 1 selector: @@ -49,26 +13,55 @@ spec: labels: app: itop spec: + securityContext: + fsGroup: 33 # ensures www-data can write to volumes containers: - - name: itop - image: allardkrings/itop:external - env: - - name: ITOP_DB_HOST - value: mariadb.mariadb - - name: ITOP_DB_NAME - value: itop - - name: ITOP_DB_USER - value: itop - - name: ITOP_DB_PASS - value: itop - volumeMounts: - - mountPath: /var/www/html/conf - name: itop - subPath: conf + - name: itop + image: vbkunin/itop:latest + imagePullPolicy: Always + ports: + - containerPort: 80 + env: + - name: ITOP_DB_HOST + value: mariadb.mariadb + - name: ITOP_DB_NAME + value: itop + - name: ITOP_DB_USER + value: itop + - name: ITOP_DB_PASS + value: itop + 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: - - name: itop - persistentVolumeClaim: - claimName: itop-pvc + - name: conf + persistentVolumeClaim: + 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 kind: Service diff --git a/dev/itop/pvc.yaml b/dev/itop/pvc.yaml new file mode 100755 index 0000000..39ec6e6 --- /dev/null +++ b/dev/itop/pvc.yaml @@ -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 diff --git a/dev/itop/test.sh b/dev/itop/test.sh deleted file mode 100755 index e1e9d60..0000000 --- a/dev/itop/test.sh +++ /dev/null @@ -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" -} diff --git a/dev/mariadb/README.md b/dev/mariadb/README.md new file mode 100644 index 0000000..9fbd886 --- /dev/null +++ b/dev/mariadb/README.md @@ -0,0 +1,2 @@ +User: root +Password: jamesbrown diff --git a/dev/tekton/tasks/register-change/debug-register-change.sh b/dev/tekton/tasks/register-change/debug-register-change.sh new file mode 100755 index 0000000..42c7e43 --- /dev/null +++ b/dev/tekton/tasks/register-change/debug-register-change.sh @@ -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 <&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 diff --git a/dev/tekton/tasks/register-change/register-change-task.yaml b/dev/tekton/tasks/register-change/register-change-task.yaml index d098fdf..cba1841 100755 --- a/dev/tekton/tasks/register-change/register-change-task.yaml +++ b/dev/tekton/tasks/register-change/register-change-task.yaml @@ -1,4 +1,4 @@ -apiVersion: tekton.dev/v1 # or tekton.dev/v1beta1 +apiVersion: tekton.dev/v1beta1 # or tekton.dev/v1beta1 kind: Task metadata: name: register-change diff --git a/dev/tekton/tasks/register-change/register-change.sh b/dev/tekton/tasks/register-change/register-change.sh index ff50eac..2f5ebe2 100755 --- a/dev/tekton/tasks/register-change/register-change.sh +++ b/dev/tekton/tasks/register-change/register-change.sh @@ -1,5 +1,5 @@ #!/bin/bash -ITOP_URL="http://itop.alldcs.nl" +ITOP_URL="https://itop-dev.allarddcs.nl" ITOP_USER="tekton" ITOP_PWD="Itop01@@@" ORGANIZATION="0001" diff --git a/lp/matrix/hookshot-certificate.yaml b/lp/matrix/hookshot-certificate.yaml new file mode 100644 index 0000000..31128c5 --- /dev/null +++ b/lp/matrix/hookshot-certificate.yaml @@ -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 diff --git a/lp/matrix/hookshot.yaml b/lp/matrix/hookshot.yaml index 2dbed98..5f30db9 100644 --- a/lp/matrix/hookshot.yaml +++ b/lp/matrix/hookshot.yaml @@ -84,7 +84,22 @@ spec: apiVersion: traefik.io/v1alpha1 kind: IngressRoute 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 spec: entryPoints: @@ -96,7 +111,7 @@ spec: - name: matrix-hookshot port: 9000 tls: - certResolver: default + secretName: hookshot.allarddcs.nl-tls --- apiVersion: v1 kind: PersistentVolume diff --git a/lp/matrix/matrix.yaml b/lp/matrix/matrix.yaml index 06b2764..09fac44 100755 --- a/lp/matrix/matrix.yaml +++ b/lp/matrix/matrix.yaml @@ -84,7 +84,6 @@ spec: port: 8008 tls: secretName: matrix-lp.allarddcs.nl-tls -# certResolver: letsencrypt --- apiVersion: v1 kind: PersistentVolume diff --git a/riscv/zabbix/README.md b/riscv/zabbix/README.md index a02c18b..2822dcf 100644 --- a/riscv/zabbix/README.md +++ b/riscv/zabbix/README.md @@ -1 +1,3 @@ -Dit is een catalogus van alle yamls en values die gebruikt worden in de clusters van Allard +User : Admin +passord: zabbix +