Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want a command to run automatically on my NAS control station which is linux based.

nas_pool -size -a to run everyday at 12 AM .

I have my Control station IP added to exchange server and getting mail to my ID using mail -v Example@ID.com

I want the NAS utilization report to run nas_pool -size -a which gives the output as:

id = 3

name = clar_r5_performance

used_mb = 8388736

avail_mb = 405784

total_mb = 8794520

potential_mb = 0

can somebody help me with how to configure this output to my mail ID.

Your help will be appreciated!

I am not that comfortable around Linux so a step by step approach will help understand better. Thanks a lot for your time..

share|improve this question

2 Answers 2

Direct answer is using cron on that device to do it. Without knowing the device, I can't tell you how to do this. Consult the product documentation for setting up cron or running 'scheduled tasks'.

The data that you want looks like it should be available via SNMP. I would look into setting up something to poll it periodically using SNMP. You can then put it in an RRD graph for historical analysis or have a log file on the external polling station with all of the results. I try to avoid email whenever possible, it's wasteful. Just an idea, your device should have documentation explaining how to set up SNMP on it if it supports it.

share|improve this answer

If that NAS is linux based and you have access to it, then it should probably have cron(*nix scheduler)

You can edit cron configuration by running

crontab -e

That's how crontab file would look tp run your command at 12am daily and email it's results to email@host.com:

MAILTO:email@host.com
0 0 * * * nas_pool -size -a

Overall, you should read more about cron as there are tons of great tutorials online.

share|improve this answer
    
Alternately: 0 0 * * * nas_pool -size -a | mail -s 'NAS usage report' user@example.com –  Sean Reifschneider Nov 25 '10 at 7:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.