NSclient script modification questions

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
gwish
Posts: 2
Joined: Wed Jan 28, 2004 7:48 pm

NSclient script modification questions

Post by gwish »

Jazzee was nice enough to post some scripts that utilized the NSclient used in Nagios.

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";
This code works perfect for me to grab cpu load. (just a minor adjustment for me in bsd)

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest