0

I am trying to create a dashboard for my Rundeck

I want to Have no of jobs executed, passed ,Failed, Terminated which is available in Activity log in Rundeck tool. But that cannot be downloaded in excel sheet..Here is the Dashboard Format , i am Looking

I want to download the data on basis of day, weekly and monthly and then use tableau to create a dashboard. let me know

or is their anyway i can integrate my rundeck and tableau directly and create a similar dashboard

Bernard
  • 37
  • 1
  • 10

1 Answers1

0

You can get all those data from API, (for example getting execution info):

#!/bin/sh

# protocol
protocol="http"

# basic rundeck info
rdeck_host="localhost"
rdeck_port="4440"
rdeck_api="36"
rdeck_token="nMp0uRsNUAH0w17JXxoDPqoBq6V4mB2O"

# specific api call info
execution="2"

# get the job forecast
curl -s --location --request GET "$protocol://$rdeck_host:$rdeck_port/api/$rdeck_api/execution/$execution" \
  --header "Accept: application/json" \
  --header "X-Rundeck-Auth-Token: $rdeck_token" | jq

Output:

{
  "id": 2,
  "href": "http://localhost:4440/api/36/execution/2",
  "permalink": "http://localhost:4440/project/ProjectEXAMPLE/execution/show/2",
  "status": "succeeded",
  "project": "ProjectEXAMPLE",
  "executionType": "user",
  "user": "admin",
  "date-started": {
    "unixtime": 1606853136420,
    "date": "2020-12-01T20:05:36Z"
  },
  "date-ended": {
    "unixtime": 1606853136878,
    "date": "2020-12-01T20:05:36Z"
  },
  "job": {
    "id": "900a885b-576c-4c8c-a118-4bd1bf775c7b",
    "averageDuration": 458,
    "name": "Test",
    "group": "",
    "project": "ProjectEXAMPLE",
    "description": "",
    "href": "http://localhost:4440/api/36/job/900a885b-576c-4c8c-a118-4bd1bf775c7b",
    "permalink": "http://localhost:4440/project/ProjectEXAMPLE/job/show/900a885b-576c-4c8c-a118-4bd1bf775c7b"
  },
  "description": "echo $LANG [... 2 steps]",
  "argstring": null,
  "serverUUID": "bd2d85ef-f9f9-4805-b51c-a4bbcf5875e3",
  "successfulNodes": [
    "localhost"
  ]
}

And if you want to filter you can use any JSON parser tool, on my example I have used JQ (jq -r .status to get the status of execution):

#!/bin/sh

# protocol
protocol="http"

# basic rundeck info
rdeck_host="localhost"
rdeck_port="4440"
rdeck_api="36"
rdeck_token="nMp0uRsNUAH0w17JXxoDPqoBq6V4mB2O"

# specific api call info
execution="2"

# get the job forecast
curl -s --location --request GET "$protocol://$rdeck_host:$rdeck_port/api/$rdeck_api/execution/$execution" \
  --header "Accept: application/json" \
  --header "X-Rundeck-Auth-Token: $rdeck_token" | jq -r .status

Output:

succeeded

So, checking the Tableau documentation, you can send your results via Tableau API. In fact, you can use Server API Client (python) to do this, maybe is a good idea to use some Rundeck job to send that data to Tableau via Tableau API on any python script step.

MegaDrive68k
  • 3,768
  • 2
  • 9
  • 51
  • Thanks , was able to achieve the above, when it comes to taking data for monthly or weekly this is not working, can you help? ``` #!/bin/sh protocol="http" rdeck_host="machinexyz.local" rdeck_port="4440" rdeck_api="35" rdeck_token="token" rdeck_project="projectRun" xy="1w" curl -s --location --request GET "$protocol://$rdeck_host:$rdeck_port/api/$rdeck_api/project/$rdeck_project/$xy" \ --header "Accept: application/json" \ --header "X-Rundeck-Auth-Token: $rdeck_token" ``` – Bernard Dec 17 '20 at 10:38