Sample customized signature script in Veritas Operations Manager 4.1
| Article:HOWTO65456 | | | Created: 2012-01-04 | | | Updated: 2012-01-04 | | | Article URL http://www.symantec.com/docs/HOWTO65456 |
#!/opt/VRTSsfmh/bin/perl
BEGIN { @INC = ("/opt/VRTSsfmh/lib/modules"); }
use strict;
if ($ARGV[0] eq "--what")
{
print "CHECK_ID: PC_VXVM_UNUSED_VOLUMES\n";
print "CHECK_NAME: VxVM Unused Volumes\n";
print "CHECK_DESCRIPTION: Check to see if any VxVM volumes are unused.\n";
print "CHECK_KEYWORDS: UTILIZATION UNIX VXVM\n";
exit (0);
}
if($^O =~ /Win32/i)
{
print "RESULT_RC=100\n";
print "RESULT_TXT=Windows host detected\n";
print "RESULT_REMEDY=This check is intended only for unix hosts\n";\
exit(100);
}
my $exitcode = 0;
my @items = '/opt/VRTSsfmh/bin/vxlist -t stats vol';
my $iocount = {};
foreach (@items) {
if(/^vol\s+(\S+)\s+(\S+)\s+(read|write)\s+(\S+)\s+/) {
my $name = $2."/".$1;
$iocount->{$name} += $4;
}
}
foreach (keys %$iocount) {
if($iocount->{$_} == 0) {
/(\S+)\/(\S+)/;
print "RESULT_RC=2\n";
print "RESULT_TXT=VxVM volume $2 in disk group $1 may be unused. It has performed no I/O since last reboot.\n";
print "RESULT_REMEDY=There may be data on the volume, such as an unmounted file system. If not, space can be reclaimed by deleting the volume,\n";
$exitcode = 2;
}
}
exit($exitcode);See About creating a customized signature script in Veritas Operations Manager 4.1
|
|
Legacy ID
v59326166_v67722951
Article URL http://www.symantec.com/docs/HOWTO65456
Terms of use for this information are found in Legal Notices









Thank you.