# Monitoring & Scheduling

{% hint style="warning" %}
**Workshop - Monitoring & Scheduling**

In this guided demonstration, you will:

* Configure a Repository connection.
* Monitor a Job / Transformation.
* Schedule a Job / Transformation.
  {% endhint %}

{% embed url="<https://www.loom.com/share/abea3eeabf664b9ab330594d2c562699?hideEmbedTopBar=true&hide_owner=true&hide_share=true&hide_title=true>" %}
Scheduling
{% endembed %}

***

{% tabs %}
{% tab title="1. Monitor" %}
{% hint style="info" %}
One way to monitor a Pentaho Transformations / Jobs is to use the PDI Status page, which shows you the details of remotely executed and scheduled transformations, such as the date and time they were run, their status and results.

To access the PDI Status page, you need to navigate to the /pentaho/kettle/status page on your Pentaho Server, and change the host name and port to match your configuration.

Another way to monitor a Pentaho transformation is to enable logging and step performance monitoring in the PDI client. Logging provides you with summarized and detailed information about a transformation, such as the number of records inserted, the total elapsed time, and any errors or exceptions.

Step performance monitoring allows you to see how each step in your transformation is performing in terms of speed, memory usage, and input/output rates.
{% endhint %}

**Monitor**

{% hint style="info" %}
Now that executed the transformation against the Pentaho server kettle engine you can remotely log into the service to monitor the tasks.
{% endhint %}

1. Click on the following URL:

{% embed url="<http://localhost:8080/pentaho/kettle/status>" %}
Monitor - Pentaho server
{% endembed %}

2. Log into the service.

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-1c84d6f4262e5299f7654dbc455a55bbf3982cee%2FLog%20into%20monitor%20service.png?alt=media" alt=""><figcaption><p>Log into service</p></figcaption></figure>

<table data-header-hidden><thead><tr><th width="211"></th><th></th></tr></thead><tbody><tr><td>Username</td><td>admin</td></tr><tr><td>Password</td><td>password</td></tr></tbody></table>

{% hint style="info" %}
From here you can perform a number of operations:

• RUN the Transformation / Job.

• Stop the running Transformation / Job.

• View Transformation / Job details.

• Remove Transformation / Job.
{% endhint %}

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-8b1fb41a7db8f3874d65571fabb870613e4f4a36%2FMonitor%20status.png?alt=media" alt=""><figcaption><p>PDI status</p></figcaption></figure>

{% hint style="info" %}
For monitoring remote servers, log in with the following URL format:

• http\://\[IP address / FQDN]: \[Port]/kettle/status

• Default Username / Password: cluster/cluster
{% endhint %}
{% endtab %}

{% tab title="2. Scheduling" %}
{% hint style="info" %}
If you have a transformation or a job stored in the Pentaho Repository, you can use the Schedule perspective in the PDI client to create and manage schedules. You can specify the start and end date and time, the repeat frequency, the log level, and the safe mode for the transformation or job.

You can also edit, delete, enable, disable, or stop the schedules from the Schedule perspective.
{% endhint %}

{% tabs %}
{% tab title="2.1 Repository Connection" %}
{% hint style="warning" %}
Ensure that the Pentaho server is up and running ..

Pentaho Repository.
{% endhint %}

1. Click on the Connect button (top right on canvas).
2. Click Add and Enter the following details:

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-aef80b5f0d43d3558fc0fa27ef7ba6ca3fbd290b%2FRepository.png?alt=media" alt=""><figcaption><p>Repository connection</p></figcaption></figure>

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-ba88346178af7814c2f36556d89ccb8abf165429%2FRepository%20-%20Pentaho.png?alt=media" alt=""><figcaption><p>Pentaho Repository</p></figcaption></figure>

3. Save & Close.

**To connect to the Repository**

1. Click on the Connect button.
2. Select the connection (Pentaho).
3. Enter credentials:

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-b51c5653de2068ef92139fd6ce5a0d4bd21cdfa1%2FRepository%20credentials.png?alt=media" alt=""><figcaption></figcaption></figure>

<table data-header-hidden><thead><tr><th width="204"></th><th></th></tr></thead><tbody><tr><td><strong>Username</strong></td><td>admin</td></tr><tr><td><strong>Password</strong></td><td>password</td></tr></tbody></table>

4. Click on login.
   {% endtab %}

{% tab title="2.2 Upload" %}
{% hint style="info" %}
Lets upload tr\_hello\_world.ktr and RUN.

As you're connected to the 'Pentaho' Repository, you will need to browse for the transformation locally.
{% endhint %}

1. Select File -> Import from an XML file ..

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-e784e3faedf380e26ad1b52dd770f8376c392ad7%2FImport%20ktr.png?alt=media" alt=""><figcaption><p>Import XML file</p></figcaption></figure>

2. Browse to:

/home/pentaho/Workshop--Data-Integration/Labs/Module 5 - Enterprise Solution/Topic 4 - Monitor

3. Select: tr\_hello\_world.ktr & Open.

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-fc5dd69a2e8e3187b1f938ea92fe174045491208%2Fpath%20to%20tr_hello_world.png?alt=media" alt=""><figcaption><p>path to tr_hello_world.ktr</p></figcaption></figure>

{% hint style="warning" %}
Change the File type: \*.ktr
{% endhint %}

4. Click Save.
5. Let's create a Public / Demo folder.

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-a04d7bb9323c3edd9db43d93cb07663be5a05d95%2Fcreate%20Demo%20folder.png?alt=media" alt=""><figcaption><p>Create a Public Demo folder</p></figcaption></figure>

6. Enter demo and Save.

{% hint style="info" %}
Let's now RUN the transformation on the Pentaho server.
{% endhint %}

7. Log into the Pentaho User Console.

{% embed url="<http://localhost:8080/pentaho/Login>" %}

| Username | Admin    |
| -------- | -------- |
| Password | password |

8. Select Browse Files -> Public -> Demo
9. Highlight the tr\_hello\_world and under File Actions, click open.
10. Click the Close window.

This indicates that the transformation has been successfully executed.
{% endtab %}

{% tab title="2.3 Quartz Scheduler" %}
{% hint style="warning" %}
Ensure that the Pentaho server is up and running and that you have connected to the Pentaho Repository - see previous Monitor section.

Transformations /Jobs need to uploaded into the Pentaho Repository.
{% endhint %}

1. Connect to the 'Pentaho' Repository.
2. Open the tr\_hello\_world.ktr
3. From the main menu select: Action -> Schedule

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-fb6c1dfb133e8e244473d19fb0cce77dfe6e0e77%2FSchedule%20transformation.png?alt=media" alt=""><figcaption><p>Schedule transformation</p></figcaption></figure>

4. Enter the following settings:

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-4161dccef363f74603a350e2ae9bf3435a25a816%2FSchedule%20options.png?alt=media" alt=""><figcaption><p>Scheduling options</p></figcaption></figure>

5. Monitor the status (Periodically, refresh the browser).

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-cfa1617ceda70b2c94d94c095a957cb2fa2c2297%2FSchedule%20status%2030%20secs.png?alt=media" alt=""><figcaption><p>Monitor status.</p></figcaption></figure>

5. To manage the Schedule, switch to the Schedule perspective.

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-0c718eab15eb55d3d979f2ec270b2728f1c7b888%2FScheduler%20perspective.png?alt=media" alt=""><figcaption><p>Scheduler perspective</p></figcaption></figure>

5. Highlight the tr-hello\_world schedule.

<figure><img src="https://3680356391-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZpCSy6Skj215f4oWypdc%2Fuploads%2Fgit-blob-a2a8f22d6ea2d6852a63687eafc2c52ecd552e9d%2FManage%20schedule.png?alt=media" alt=""><figcaption><p>Manage schedule</p></figcaption></figure>

6\. Disable the schedule an switch back to the Data Integration perspective.
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}
