foobar2devnull
ADSM.ORG Member
Hi all,
I am trying to write a script that will "scrape" data from multiple instances so that I can generate a basic backup report.
The problem I am facing is with the use of:
represented in my script by "$1:" which does not seem to work so I'd have to run the script on each server rather than from a single one... unless one of you has a fab solution. Do you?
My script:
How I use it:
Output:
Regardless of the instance I provide, it only ever outputs the "local instance"
So if I have three servers with three instances inst1, inst2 and inst3 and I run the script from inst1:
all return the output of inst1
I am trying to write a script that will "scrape" data from multiple instances so that I can generate a basic backup report.
The problem I am facing is with the use of:
instance name: foo
represented in my script by "$1:" which does not seem to work so I'd have to run the script on each server rather than from a single one... unless one of you has a fab solution. Do you?
My script:
/* ------------------------------------------------------------ */
/* Script Name: REPORT_LASTLNXBACKUPS */
/* Description: List of the Linux backups in the last 24 hours */
/* arg: the argument defines the instance we are querying */
/* ------------------------------------------------------------ */
$1: SELECT cast(SUBSTR(CHAR(e.actual_start),1,19 ) as char(16)) AS "START TIME", e.SCHEDULE_NAME AS "SCHEDULE NAME", e.NODE_NAME AS "NODE NAME", n.PLATFORM_NAME AS "PLATFORM",
e.STATUS, e.RESULT -
FROM events e JOIN nodes n ON e.NODE_NAME = n.NODE_NAME -
WHERE scheduled_start BETWEEN current_timestamp - 24 hours AND current_timestamp -
AND PLATFORM_NAME like '%Linux%' -
ORDER BY e.RESULT desc, SCHEDULE_NAME, e.node_name, e.status
/* Script Name: REPORT_LASTLNXBACKUPS */
/* Description: List of the Linux backups in the last 24 hours */
/* arg: the argument defines the instance we are querying */
/* ------------------------------------------------------------ */
$1: SELECT cast(SUBSTR(CHAR(e.actual_start),1,19 ) as char(16)) AS "START TIME", e.SCHEDULE_NAME AS "SCHEDULE NAME", e.NODE_NAME AS "NODE NAME", n.PLATFORM_NAME AS "PLATFORM",
e.STATUS, e.RESULT -
FROM events e JOIN nodes n ON e.NODE_NAME = n.NODE_NAME -
WHERE scheduled_start BETWEEN current_timestamp - 24 hours AND current_timestamp -
AND PLATFORM_NAME like '%Linux%' -
ORDER BY e.RESULT desc, SCHEDULE_NAME, e.node_name, e.status
How I use it:
run REPORT_LASTLNXBACKUPS TSMINST1
Output:
Regardless of the instance I provide, it only ever outputs the "local instance"
So if I have three servers with three instances inst1, inst2 and inst3 and I run the script from inst1:
run REPORT_LASTLNXBACKUPS inst1
run REPORT_LASTLNXBACKUPS inst2
run REPORT_LASTLNXBACKUPS inst3
run REPORT_LASTLNXBACKUPS inst2
run REPORT_LASTLNXBACKUPS inst3
all return the output of inst1