HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- SQL Query in SIM 6.1
Server Management - Systems Insight Manager
1833737
Members
2687
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2010 04:36 AM
12-02-2010 04:36 AM
SQL Query in SIM 6.1
Hi, I'm a SQL newbie but I've managed to run a SQL query against our SQL 2008 database backend (separate server from SIM 6.1). However, I don't know how to exclude the CDROM and floppy disk drives from the report. Can anyone help? I'm guessing I need to put something like a WHERE description = 'CDROM' but I need help with the syntax.
Also, what do you do with the results of the query? I'd like to email it in htm format or Excel or save it to a share. Anything that looks pretty, is automated and accessible.
I've pasted code below that I'm using from "Show SQL Queries".
I find it very frustrating that I'm having to learn to be a SLQ developer because SIM won't do the reports that I want.
SQL query used to generate the data in the table: Logical Disk Drives
select R_LogicalDisks.DeviceName, R_LogicalDisks.Description, R_LogicalDisks.SizeMb, R_LogicalDisks.UsedMb, R_LogicalDisks.UsedPercent from R_LogicalDisks WHERE ((R_LogicalDisks.SnapShotID=-1) OR (R_LogicalDisks.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices LEFT OUTER JOIN notices ON devices.deviceKey = notices.deviceKey LEFT OUTER JOIN DB_deviceInfoEx ON devices.deviceKey = DB_deviceInfoEx.deviceKey LEFT OUTER JOIN IPAddress ON devices.deviceKey = IPAddress.deviceKey and IPAddress.ipIndex = 0 LEFT OUTER JOIN associated_device_data ON devices.deviceKey = associated_device_data.deviceKey LEFT OUTER JOIN deviceProtocolInfo ON devices.deviceKey = deviceProtocolInfo.deviceKey LEFT OUTER JOIN simAggrStatus ON devices.deviceKey = simAggrStatus.deviceKey LEFT OUTER JOIN DeviceStatusValue ON devices.deviceKey = DeviceStatusValue.deviceKey and DeviceStatusValue.StatusSourceId= 6 JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '0000005056870c0b0000000400000006' WHERE ( ( devices.productType = 1) ) ) order by R_LogicalDisks.DeviceName ASC
thanks,
Franny
Also, what do you do with the results of the query? I'd like to email it in htm format or Excel or save it to a share. Anything that looks pretty, is automated and accessible.
I've pasted code below that I'm using from "Show SQL Queries".
I find it very frustrating that I'm having to learn to be a SLQ developer because SIM won't do the reports that I want.
SQL query used to generate the data in the table: Logical Disk Drives
select R_LogicalDisks.DeviceName, R_LogicalDisks.Description, R_LogicalDisks.SizeMb, R_LogicalDisks.UsedMb, R_LogicalDisks.UsedPercent from R_LogicalDisks WHERE ((R_LogicalDisks.SnapShotID=-1) OR (R_LogicalDisks.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices LEFT OUTER JOIN notices ON devices.deviceKey = notices.deviceKey LEFT OUTER JOIN DB_deviceInfoEx ON devices.deviceKey = DB_deviceInfoEx.deviceKey LEFT OUTER JOIN IPAddress ON devices.deviceKey = IPAddress.deviceKey and IPAddress.ipIndex = 0 LEFT OUTER JOIN associated_device_data ON devices.deviceKey = associated_device_data.deviceKey LEFT OUTER JOIN deviceProtocolInfo ON devices.deviceKey = deviceProtocolInfo.deviceKey LEFT OUTER JOIN simAggrStatus ON devices.deviceKey = simAggrStatus.deviceKey LEFT OUTER JOIN DeviceStatusValue ON devices.deviceKey = DeviceStatusValue.deviceKey and DeviceStatusValue.StatusSourceId= 6 JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '0000005056870c0b0000000400000006' WHERE ( ( devices.productType = 1) ) ) order by R_LogicalDisks.DeviceName ASC
thanks,
Franny
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2010 03:14 PM
12-02-2010 03:14 PM
Re: SQL Query in SIM 6.1
You're going to have to learn some kind of scripting language if you want to do this kind of stuff.
The SQL command you're missing is: "<>"
e.g. in a perl script I have the SQL is:
SELECT CAST (CIM_LogicalDisk.SystemName as CHAR(35)),
CAST (CIM_LogicalDisk.Description as CHAR(30)),
CIM_LogicalDisk.dc_PercentSpaceUsed, CAST (CIM_LogicalDisk.DeviceID as CHAR(25))
FROM CIM_LogicalDisk
WHERE (CIM_LogicalDisk.SnapshotID=-1) AND
(CIM_LogicalDisk.dc_PercentSpaceUsed>='80') AND
((CIM_LogicalDisk.Description<>'Network Connection') AND
(CIM_LogicalDisk.Description<>'3 1/2 Inch Floppy Drive') AND
(CIM_LogicalDisk.Description<>'CD-ROM Disc')AND
(CIM_LogicalDisk.SystemName Not Like '10.%'))
order by CIM_LogicalDisk.SystemName ASC
It's also a bit primitive, but I'm not a developer either.
The CAST command sets the length of the output, makes it easier for me to cut up and process.
This just extracts those disks that are over 80% full. Ignores various devices and items listed as IP addresses only.
The SQL command you're missing is: "<>"
e.g. in a perl script I have the SQL is:
SELECT CAST (CIM_LogicalDisk.SystemName as CHAR(35)),
CAST (CIM_LogicalDisk.Description as CHAR(30)),
CIM_LogicalDisk.dc_PercentSpaceUsed, CAST (CIM_LogicalDisk.DeviceID as CHAR(25))
FROM CIM_LogicalDisk
WHERE (CIM_LogicalDisk.SnapshotID=-1) AND
(CIM_LogicalDisk.dc_PercentSpaceUsed>='80') AND
((CIM_LogicalDisk.Description<>'Network Connection') AND
(CIM_LogicalDisk.Description<>'3 1/2 Inch Floppy Drive') AND
(CIM_LogicalDisk.Description<>'CD-ROM Disc')AND
(CIM_LogicalDisk.SystemName Not Like '10.%'))
order by CIM_LogicalDisk.SystemName ASC
It's also a bit primitive, but I'm not a developer either.
The CAST command sets the length of the output, makes it easier for me to cut up and process.
This just extracts those disks that are over 80% full. Ignores various devices and items listed as IP addresses only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2010 06:08 AM
12-03-2010 06:08 AM
Re: SQL Query in SIM 6.1
thanks for your response. I don't know anything about Perl but I downloaded Strawberry Perl to give your script a go but I'm not sure how to connect to the SQL DB to run it, and running it standalone brought up syntax errors. I've spent all day reading beginners guide to Perl tutorials.
I have a script from Microsoft's web site that will read in a list of servers and give me a disk usage report but I don't want to have to maintain the list manually, I'd rather get the list from SIM so that it's always up-to-date.
If there's a CD in the drive the standard logical disk report from Managed Reports says the disk is 100% full, some of the servers are remote so it's not practical to eject the CDs so they don't show up in the report.
We would also like to have a disk report that only shows C and D drives. It's very time consuming all of this.
I have a script from Microsoft's web site that will read in a list of servers and give me a disk usage report but I don't want to have to maintain the list manually, I'd rather get the list from SIM so that it's always up-to-date.
If there's a CD in the drive the standard logical disk report from Managed Reports says the disk is 100% full, some of the servers are remote so it's not practical to eject the CDs so they don't show up in the report.
We would also like to have a disk report that only shows C and D drives. It's very time consuming all of this.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP