Contents
How to use file system Perl to check disk usage?
The list is empty with just the headers being sent. Added code that sends the email if a file system is found which exceeds its threshold otherwise exits the script. Eliminated two system calls by using built-in Sys::Hostname and POSIX modules; Removed the $os variable and replaced it with direct use of $uname [0] established with POSIX::uname ()
How to write a Perl script to monitor disk space?
Perl script code to monitor disk space Now write a perl script called df.pl: $ vi df.pl Append following code:
Why do I need to write a Perl script?
Result is more code than would normally be required in order to format HTML and send email as well as make system calls which are less desirable.
How to monitor disk space and send an email?
→Perl script to monitor disk space and send an email Perl script to monitor disk space and send an email Author:Vivek GiteLast updated:February 21, 200736comments Here is a quick question by one of our regular reader : Sponsored links A handy ssh book for beginners and forgetful veteran developers and Unix/Linux/macOS users
How to install libfilesys-diskspace-Perl script in Perl?
First you need to install this perl module using apt-get or from cpan (Comprehensive Perl Archive Network). $ sudo apt-get install libfilesys-diskspace-perl
Why do I get a message in my Perl terminal?
After the script successfully completes its job and before Perl interpreter exits, I get this message in the terminal: It would be nice to have your opinion about the code correctness, and get a piece of advice about how to avoid that message, as a bonus. UPDATE: The message mentioned gone away when I replaced ‘\\*STDIN’ arg with ‘undef’.
Are there any disadvantages to using IPC run in Perl?
The only disadvantage, in my opition, is that IPC::Run is not part of standard Perl distribution:
https://www.youtube.com/watch?v=ovS2GrHUW8k