Unsolved
This post is more than 5 years old
4 Posts
0
9743
February 9th, 2015 09:00
File System Usage Stats via CLI
I am looking for the command to use with naviseccli to grab the list of file systems, storage capacity, file usage stats at the time of the query. I was not able to find the term file systems within the CLI
Is it possible to grab that information from the CLI? If so what is the command?



umichklewis
3 Apprentice
•
1.2K Posts
0
February 9th, 2015 13:00
If you're looking for filesystems on a Clariion, you won't find them.
The Clariion is a block array, and the LUN data tracked by naviseccli doesn't report the usage of the LUN, just the total block count and the number of blocks written to a LUN. However, this tell you how "full" the LUN is - you have to determine that from the host-side.
If you're looking for filesystem usage on a Celerra or VNX, you won't be able to obtain that usage from naviseccli, as this tool only reports data related to LUNs.
You can obtain filesystem usage by logging into the Celerra or VNX control station. If this query is about Celerra or VNX, you'll want to move this question to that forum.
Let us know if that helps!
Karl
DELL-Sheron G
Moderator
•
228 Posts
0
February 10th, 2015 02:00
Hello Paul,
As Karl mentioned the Clariion is a block device and knows nothing about the filesystem.
What is that you trying to find, disk usage?
Regards,
Sheron Godfred
serco_paul
4 Posts
0
February 10th, 2015 05:00
Hi Karl,
Currently I export daily CSVs for each file system from the Unisphere > System > Monitoring and Alerts > Statistics for File
The manual method was only meant for development to setup the process and trending algorithms development. Its too cumbersome and time intensive for daily usage. Though it looks like I may not be able to perform the file system usage collection from the Navisphere CLI, which I though I would based on other CLIs.
I know how to collect it from the Linux command line via SSH session using nas_fs commands.
I think I will end up creating a cron job or the like to collect the data as a text file. Then have another server collect the data from the text file and pipe it to our SQL server for permanent storage and analysis. Seems kinda klugy but I have to work with what I got.
I appreciate your response Karl. I will move this to the VNX community.
Respectfully,
Paul
serco_paul
4 Posts
0
February 10th, 2015 05:00
Hi Sheron,
Sort of, I want to collect the File System Usage hourly. Not the LUN or Block but the file system sitting on top of that. We use some of the file systems as shares and other times as storage for vmdks. I need to get the raw data out of the Unisphere interface and into a SQL table so that we can same the usage stats long term, for trending analysis, and alerting.
I was hoping that naviseccli would support the extraction of the data that is collection within the Linux VNC OS using the command nas_fs but there doesn't seem to be a related command. Do you know of another automated way to get that data?
Respectfully,
Paul
DELL-Sheron G
Moderator
•
228 Posts
0
February 10th, 2015 05:00
Hello Paul,
Assuming the clariion has an NAS system like a celerra connected then from celerra you might be able to extract the info about the the file system usage, I have not worked on celerra so am not sure about how to do it.
But if it is from the clariion then you can get the performance logs/nar files that will give you a detailed graph on the block data ( just the block data). I will check with any of the celerra folks to see if there is any way to get this data.
As far as I know I do not remember any navicli command that would help you get filesystem info.
Regards,
Sheron
DELL-Sheron G
Moderator
•
228 Posts
1
February 10th, 2015 06:00
https://support.emc.com/docu47567_VNX-Command-Line-Interface-Reference-for-File-8.1.pdf?language=en_US
Might help you.
dynamox
9 Legend
•
20.4K Posts
1
February 10th, 2015 06:00
nas_fs -query:inuse=y:type=uxfs:isroot=false -fields:ServersNumeric,Id,Name,SizeValues -format:'%s,%s,%s,%s\n'
Rainer_EMC
4 Operator
•
8.6K Posts
0
February 10th, 2015 08:00
Yes the query option is nice for the commands that have it since you can just output the values you want in your format like csv and don’t worry about screen scraping.
Some more Info you that is in the VNX File reference guide in the appendix called scripting guidelines
Seems to be overlooked a lot since its at the back of the manual
serco_paul
4 Posts
1
February 18th, 2015 06:00
I appreciate each of you that answered. It helped me develop a solution. Its a little frustrating that the NaviSecCLI doesnt provide the functionality of collection the nas_fs directly. To solve the problem I wrote a shell script that is run by cron hourly to collect the usage stats on each file system and append that into a text file. The text file is collected using powershell and winscp on our script server and then ingested into a SQL server. At 7 am we collect the previous day's stats, ingest into SQL, and then perform our trending analysis.
Why do all of this because I know you can see all of this info from the Java interface and collect it manually? We wanted to be incontrol of how the information is presented, trended, and alerting.
Here is the script for the Linux side. It was interesting, you need the NAS_DB code in a shell script that is not needed when running from bash.
Here is the cron job for nasadmin. You need the PATH to the /nas/bin in the crontab -e so that nas_fs works when running the shell script so that it can find the executable.
The Powershell script contains too much proprietary and network info to paste here. It uses winscp and its .net library to connect to the NAS, pull the text file with the previous days data, and pipes that into a SQL table.
We use the SQL table to manipulate the data for trending analysis, alerting, and reports.
If you have any questions, let me know! If you think it would be helpful, I could do a better more step by step with issues I had to solve. Thanks again for your help!
DELL-Sheron G
Moderator
•
228 Posts
0
February 18th, 2015 06:00
Bravo
Someone wise said "If you really want something to be done right, then do it yourself".
And appreciate you sharing the info too.
Thank you Paul
Rainer_EMC
4 Operator
•
8.6K Posts
2
February 18th, 2015 07:00
Looks good
Regarding navicli not show file system values – thats by design.
Navicli is the CLI for the block part
The CLI on the control station like nas_ and fs_ commands are responsible for the file part.
Being an old Celerra person I like the file CLI better anyway ☺
There are also some PowerShell cmdlets as part of ESI (EMC Storage Integrator)
See https://support.emc.com/docu41343_EMC-Storage-Integrator-PowerShell-Toolkit.pdf
Rainer_EMC
4 Operator
•
8.6K Posts
0
February 23rd, 2015 00:00
I agree with Ralf - the less commands you fork the better
thomas_texier
2 Posts
0
April 27th, 2016 03:00
hi guys,
for those who might be interested:
./check-nas_fs.sh -w 80 -c 90
fsId:214,fsName:FS-XXX,TotalSize:4130240,CurrentlyUsed:2,CurrentlyUsedPercent:0%,status:OK
fsId:500,fsName:FS-YYY,TotalSize:5162816,CurrentlyUsed:4450269,CurrentlyUsedPercent:86%,status:WARNING
to be execute on the control station and triggered by ssh the from your supervision server (for example)
see script is below.
#!/bin/sh
globalStatus=0
critical=90
warning=80
while getopts ":w:c:" opt; do
case $opt in
w)
warning=$OPTARG
;;
c)
critical=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
for line in `nas_fs -query:inuse=y:type=uxfs:isroot=false -fields:Id,Name,SizeValues -format:'%s,%s,%s\n'`; do
id=$(/bin/cut -d, -f1 <<< "$line")
name=$(/bin/cut -d, -f2 <<< "$line")
totalsize=$(/bin/cut -d, -f3 <<< "$line")
currentsize=$(/bin/cut -d, -f5 <<< "$line")
currentpercent=$((currentsize*100/totalsize))
if [ $currentpercent \> $critical ]; then
globalStatus=1;
status="CRITICAL";
elif [ $currentpercent \> $warning ]; then
globalStatus=1;
status="WARNING";
else
status="OK";
fi;
echo "fsId:$id,fsName:$name,TotalSize:$totalsize,CurrentlyUsed:$currentsize,CurrentlyUsedPercent:$currentpercent%,status:$status"
done
exit $globalStatus
jpalmero
1 Rookie
•
17 Posts
0
October 16th, 2020 16:00
@dynamox
I realize this is a very old post, but I just inherited a VNX5800 and trying to get some metrics out of it. This command is very useful. I'm wondering what the last of the numbers mean. For example, on one of my file systems it generated:
3036900,361864,2675035,88,3109785976
Going by what I see on the Unisphere console, I can deduce the following:
Capacity: 3036900 MB
Available: 361864 MB
Used: 2675035 MB
%Used: 88 %
?: 310978576
But, I'm at a loss as to what the much larger number 3109785976 is related to. Can you shed any light?
Thank you.