PureDisk standard CLI is not that flexible as I would like it to be, but enjoy these:
This should be more usefull and less verbose.
1. List Data Selections:
# export PGPASSWORD=`/opt/pdag/bin/php /opt/pdconfigure/upgrade/legacy/actions/doafter/GetEntry.php /etc/puredisk/spa.cfg spadb password`
# /opt/pddb/bin/psql -U pddb ca -c "select id,name,agentid,dstypeid from dataselection"
2. List agents:
# /opt/pddb/bin/psql -U pddb ca -c "select id,hostname,statustypeid,mbeid FROM agent where (isserveragent=0 and statustypeid >0)"
3. Query the "constant" table for job status:
# /opt/pddb/bin/psql -U pddb ca -c "select * from executionstatustype"
4. Query for job type:
# /opt/pdcli/calls # /opt/pddb/bin/psql -U pddb ca -c "select * from jobtype"
5. Combining 3 and 4 you can query for all the jobs that have failed or were aborted by watchdog:
# /opt/pddb/bin/psql -U pddb ca -c "select job.id,job.workflowid,job.agentid,job.dsid,workflow.name,dataselection.name from job,workflow,dataselection where (executionstatus=3 or executionstatus=8) and job.workflowid=workflow.id and job.dsid=dataselection.id"
6. You may want to have just the numbers, so query for a numbers of jobs that: failed/aborted by watchdog/success with errors jobs
Failed:
# /opt/pddb/bin/psql -U pddb ca -t -c "select count(job.id) from job where executionstatus=3"
Aborted by watchdog:
# /opt/pddb/bin/psql -U pddb ca -t -c "select count(job.id) from job where executionstatus=8"
Success with errors:
# /opt/pddb/bin/psql -U pddb ca -t -c 'select count(job.id) from job where executionstatus=6'
7. List all jobs:
# /opt/pddb/bin/psql -U pddb ca -c "select * from job"
Disclaimer:
All those queries work(ed) for me at some point, I have not checked them "now" before pasting. This is a "non-supported" method. If you use "UPDATE" instead of select: you are on your own then. Be carefull with complicated queries as you may simply kill the DBMS hosting your SPA and MBE. Check the quotation marks and line breaks as this forum might have automatically affected it.
Never the less: have fun :)