Code: Select all
---
check_nt_cpu.pl <ip address>
---
#!/usr/bin/perl
$response = `/bin/check_nt -H $ARGV[0] -p 1248 -v CPULOAD -l 10,80,95`;
chomp $response;
($load) = ($response =~ /min. (\d+)\%\)/);
print "$load\n";
However I've changed the $ARGV[0] to read as the IP address of the machine I'm monitoring. I have two questions.
1. If I put the $ARGV[0] back in instead of the machine IP can I recycle the script over and over on different boxes by changing the INPUT argument in Caciti
2. Is it possible to adjust this script so that it stacks load avg. like the Unix processor load does . I know I can change the arguments on the end of the script: 10,80,95 to 5, 80,95 but is there a way to run the script once and get all the info I need for 1 minute 5 minute and 10 minute?
I should mention I'm using Freebsd 5.2 (if that matters)
Thanks in Advance.