Query About NAGIOS PLUGIN
Amit Kumar
risinamit at gmail.com
Mon Mar 30 10:03:54 CEST 2009
How can I run the check_nrpe on the local server?
Please provide me the info. will it be running as a service like nrpe
in the local server, or is it something else ,Please clarify
Here is the content of the script residing on the remote server I am
doing just a simple check using the currently used files.
#!/usr/bin/perl
use Getopt::Long;
############################ Impact ###################################
$PathOfBaselineFile = "/local/netcool/nagios/baseline";
my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
#Argument processing
my $args = GetOptions (
"paname|p=s" => \$paname);
$pa = substr($paname,0,6);
if($paname ne '') {
##### parameter check
if (( -e "/usr1/netcool/omnibus/etc/$paname.conf") && ( -e
"$PathOfBaselineFile/$paname.conf"))
{
$imp_cmd = `cat /usr1/netcool/omnibus/etc/$paname.conf | grep
ncoadmin | egrep -v lmgrd | egrep -v DeackStuckEvents.sh`;
$imp_cmd_base = `cat $PathOfBaselineFile/$paname.conf | grep
ncoadmin | egrep -v lmgrd | egrep -v DeackStuckEvents.sh`;
if($imp_cmd eq $imp_cmd_base)
{
print "OK: Impact Command line is same ! \n";
}
else
{
print "CRITICAL: Impact Command line is not same ! \n";
exit $ERRORS{'CRITICAL'};
}
}
else
{
print "$paname configuration file doesn't exist!","\n";
exit $ERRORS{'CRITICAL'};
}
Thanks,
Amit
On 3/30/09, Amit Kumar <risinamit at gmail.com> wrote:
>
> A application is running on remote server ,I want to execute a perl
> script on that remote server to cehck it's availability and other stuffs
> locally on that remote server and whatever output comes after the
> execution of that script it should be available on the nagios local
> monitoring server: Please help me out, I have done following steps:
>
> Modification on Local Nagios Server:
> 1. /usr/local/nagios/nrpe.cfg made an entry like :
>
> command[check_nrpe]=/usr/local/nagios/libexec/check_nrpe -H
> <REMOTESERVER_IP>
>
> 2. /usr/local/nagios/etc/objects/services.cfg made a following entry
> define service{
> use generic-service
> service_description Netcool status
> check_command check_nrpe!check_impact
> }
> restarted the nagios server and the nrpe server on Nagios localserver
>
>
>
> Modification done on the remote server
> 1. /usr/local/nagios/nrpe.cfg made an entry like :
>
> command[check_impact]=/root/amit/nagioscheck/nagios_impact.pl
> -p=<PROCESS_NAME>
> this perl script resides on the remote server
> restarted the nrpe server on remote server.
>
>
> Now My question is how can I get this working? I tried most of the
> things available on internet but nothing seems to be working.
> Am I missing any step or any local configuration , then please specify.
> It is giving me hard time
>
> NRPE version is same on both remote and local nagios server i.e 2.0
> and the check_nrpe utlity version on the local nagios server is also 2.0.
>
> Please help me for the same.
> Thanks in advance,
>
>
> Amit Kumar
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090330/5b6d6ab1/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list