Need help with select statement

ramohi

ADSM.ORG Member
Joined
Jun 9, 2005
Messages
85
Reaction score
0
Points
0
Location
Maryland
Website
Visit site
Hi friends,

Could you please help me with a select statement:

I need to see 'ANR1893E' in actlog for -1 day with select and not query.

regards
ramohi
 
Give this a try -

SELECT date_time,message from actlog WHERE message LIKE'ANR1893EI%' and date_time>current_timestamp-24 hours

Good Luck,
Sias
 
Need one more help please:

I need to see the status of drives and path with a select statement....

"q dr" and "q path" output via select statement

Thanks & Regards
ramohi
 
Give these a try.

Number of drives not online
SELECT COUNT(*) FROM drives WHERE NOT online='YES'

Number of drives online
SELECT COUNT(*) FROM drives WHERE online='YES'

Number of paths not online
SELECT COUNT(*) FROM paths WHERE NOT online='YES'

Number of paths online
SELECT COUNT(*) FROM paths WHERE online='YES'

Good Luck,
Sias
 
Hi, I do something like this to have a complete output of lib/drive/path/state :

SELECT
CASE
WHEN paths.online = 'YES' THEN '<span class=\"ok\">ONLINE</span>'
WHEN paths.online = 'NO' THEN '<span class=\"warn\">OFFLINE</span>'
END as PATHSTATE,
CASE
WHEN drives.online = 'YES' THEN '<span class=\"ok\">OK</span>'
WHEN drives.online != 'YES' THEN '<span class=\"warn\">ERROR</span>'
END as DRIVESTATE,
paths.destination_type, paths.library_name, paths.destination_name,
CASE
WHEN drives.drive_state = 'LOADED' THEN 'LOADED'
WHEN drives.drive_state = 'EMPTY' THEN '<span class=\"emph\">EMPTY</span>'
END as DRIVE_STATE,
CASE
WHEN drives.drive_state = 'LOADED' THEN '<span class=\"emph\">' || drives.volume_name || '</span>'
WHEN drives.drive_state = 'EMPTY' THEN '-'
END as LOADED_VOL,
drives.drive_serial, paths.device
FROM paths, drives
where paths.destination_name = drives.drive_name
order by drives.drive_serial

The output, in my case, goes into a csv file I load into a webpage (like a dashboard for various things I want to see on my Spectrum Protect server), updating every 5 min. The span class... help to color the output on the website green/red according if all is good or some error comes up.
Hope this helps.
Cheers, Igor

drv.png
 
Back
Top