8.6 Running Scheduled Report

As an administrator, the server on which the scheduled report runs can be configured by inserting a record in ZopaqueData table with name as 'run.scheduled.reports' and data fields as a list of comma separated server GUIDs on which the reports have to be run.

After updating serverGUID1 & serverGUID2 in the following query, run the query to add the 'run.scheduled.reports' entry in the zOpaqueData table:

On Oracle:

MERGE INTO zopaquedata zo
USING (
    SELECT ZUID AS OBJECT
        ,'run.scheduled.reports' AS name
        ,'serverGUID1,serverGUID2' AS data
    FROM ZZONE
    WHERE ROWNUM < 2
    ) newzo
    ON (zo.name = newzo.name)
WHEN MATCHED
    THEN
        UPDATE
        SET data = newzo.data
WHEN NOT MATCHED
    THEN
        INSERT
        VALUES (
            newzo.OBJECT
            ,newzo.name
            ,newzo.data
            );

On Microsoft SQL Server:

MERGE INTO zopaquedata zo
USING (
    SELECT TOP(1) ZUID AS OBJECT
        ,'run.scheduled.reports' AS name
        ,'serverGUID1,serverGUID2' AS data
    FROM ZZONE
    ) newzo
    ON (zo.name = newzo.name)
WHEN MATCHED
    THEN
        UPDATE
        SET data = newzo.data
WHEN NOT MATCHED
    THEN
        INSERT
        VALUES (
            newzo.OBJECT
            ,newzo.name
            ,newzo.data
            );

On PostgreSQL:

INSERT INTO zopaquedata (
    OBJECT
    ,name
    ,data
    )
VALUES (
    (SELECT ZUID FROM ZZONE LIMIT 1)
    ,'run.scheduled.reports'
    ,'serverGUID1,serverGUID2'
    ) 
ON CONFLICT(OBJECT, name) 
DO UPDATE
SET data = 'serverGUID1,serverGUID2';

The data in the database can be modified later by running the above queries.

For the changes to take effect, you can either wait for an hour without restarting the Admin Management service or restart the Admin Management service for the changes to take effect immediately.

NOTE:

  • This entry in zOpaqueData governs only the inventory-scheduled reports and does not govern the custom reports, or predefined reports. These reports will continue to run in the existing method.

  • Earlier the schedules were checked every 10 minutes. Now we are checking for the servers that are listed in zOpaqueData only. In case no entry is created in zOpaqueData, the scheduled reports run on any server in the zone like earlier.