Nagios-users Digest, Vol 58, Issue 22 - Remote Commands
Paul Singh
Paul.Singh at bamford.co.uk
Mon Mar 28 18:43:09 CEST 2011
Ok, thanks James. I'll have a look at that.
Regards,
Paul Singh
-----Original Message-----
From: nagios-users-request at lists.sourceforge.net
[mailto:nagios-users-request at lists.sourceforge.net]
Sent: 28 March 2011 17:39
To: nagios-users at lists.sourceforge.net
Subject: Nagios-users Digest, Vol 58, Issue 22
Send Nagios-users mailing list submissions to
nagios-users at lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/nagios-users
or, via email, send a message with subject or body 'help' to
nagios-users-request at lists.sourceforge.net
You can reach the person managing the list at
nagios-users-owner at lists.sourceforge.net
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Nagios-users digest..."
Today's Topics:
1. Re: Remote commands (James Pratt)
----------------------------------------------------------------------
Message: 1
Date: Mon, 28 Mar 2011 12:38:19 -0400
From: "James Pratt" <jpratt at norwich.edu>
Subject: Re: [Nagios-users] Remote commands
To: "Nagios Users List" <nagios-users at lists.sourceforge.net>
Message-ID:
<369C2BA4DE2C8F4A88BC422AD06C96BD295D9E at nuexchange.norwich.edu>
Content-Type: text/plain; charset="us-ascii"
Hi, I think your only problem may that you have no "-H $HOSTADDRESS$" on
any of your defined commands - This means they will likely execute
locally, which is probably why you see the same output.
hope that helps
jamie
From: Paul Singh [mailto:Paul.Singh at bamford.co.uk]
Sent: Monday, March 28, 2011 12:14 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Remote commands
Setup:
nagios core v 3.2.3
Nagios monitoring machine: my laptop running windows xpsp3
Remote servers to be monitored: windows server 2003
Directories:
C:\Program Files\ICW\etc\nagios\nagios.cfg
C:\Program Files\ICW\etc\nagios\nagwin\commands.cfg
C:\Program Files\ICW\etc\nagios\nagwin\contacts.cfg
C:\Program Files\ICW\etc\nagios\nagwin\localhost.cfg
C:\Program Files\ICW\etc\nagios\nagwin\templates.cfg
C:\Program Files\ICW\etc\nagios\nagwin\timeperiods.cfg
C:\Program Files\ICW\etc\nagios\nagwin\hosts.cfg
Hello. Hope you are well. First time emailing so thought better to put
too much info than not enough!
I'm trying to define services and commands that will monitor my remote
servers. So at present, I have my localhost for which I have the
following local commands in localhost.cfg:
# Define local commands
# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_pdm2 --disk --drive $ARG1$
--warning $ARG2$ --critical $ARG3$
}
# 'check_local_procs' command definition define command{
command_name check_local_procs
command_line $USER1$/check_winprocess --warning $ARG1$
--critical $ARG2$
}
# 'check_local_load' command definition
define command{
command_name check_local_load
command_line $USER1$/check_pdm2 --processor --warning $ARG1$
--critical $ARG2$ --psamples $ARG3$ --pinterval $ARG4$
}
# 'check_local_pyhsical_mem' command definition define command{
command_name check_local_physical_mem command_line $USER1$/check_pdm2
--memory physical --warning $ARG1$ --critical $ARG2$ }
# 'check_local_virtual_mem' command definition define command{
command_name check_local_virtual_mem command_line $USER1$/check_pdm2
--memory virtual --warning $ARG1$ --critical $ARG2$ }
# 'check_local_virtual_mem' command definition define command{
command_name check_local_pagefile_mem command_line $USER1$/check_pdm2
--memory pagefile --warning $ARG1$ --critical $ARG2$ } # Define a
service to check the disk space of system disk C on the local machine.
# Warning if < 20% free, critical if < 10% free space.
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description System disk
check_command check_local_disk!C:!95!99
}
# Define a service to check the number of currently running procs on the
local machine.
# Warning if > 250 processes, critical if > 400 users.
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description Total Processes
check_command check_local_procs!250!400
}
# Define a service to check the load on the local machine. 5 samples
with 5 secs intervals.
# Warning at 80%, Critical at 95%
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description Current Load
check_command check_local_load!85!95!5!5
}
# Define a service to check the physical memory usage the local machine.
# Critical if less than 90% of swap is in use, warning if 80% is in use
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description Physical memory
check_command check_local_physical_mem!80!90
}
# Define a service to check the virtual memory usage the local machine.
# Critical if less than 90% of swap is in use, warning if 80% is in use
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description Virtual memory
check_command check_local_virtual_mem!80!90
}
# Define a service to check the page file usage the local machine.
# Critical if less than 90% of swap is in use, warning if 80% is in use
define service{
use local-service ; Name of
service template to use
host_name localhost
service_description Page file
check_command check_local_pagefile_mem!80!90
}
So all these work fine for the localhost. What I'm trying to do now is
setup the exact same capability but for the remote servers, and this is
where I'm getting stuck. Although I can define a service for the remote
servers, the output displayed is the same as I have for my localhost. So
for example in the screenshot below, the c: Disk space service, the
remote service I tried to setup, is actually using the local command
line and showing the same output as the System Disk service on
localhost.
Can you please advise on how to setup up equivalent remote commands
similar to the local commands above?
Eventually, I am looking to set up equivalent remote services for
current load, page file, phys mem etc that I currently have for
localhost.
So far I have:
C:\Program Files\ICW\etc\nagios\nagwin\hosts.cfg
define service{
use remote-service ; Name of
service template to use
host_name bamford-lon-fn1
service_description c: Disk Space
check_command check_remote_disk!C:!95!99
}
C:\Program Files\ICW\etc\nagios\nagwin\localhost.cfg
# 'check_remote_disk' command definition define command{
command_name check_remote_disk
command_line $USER1$/check_pdm2 --disk --drive $ARG1$
--warning $ARG2$ --critical $ARG3$
}
C:\Program Files\ICW\etc\nagios\nagwin\templates.cfg
# Remote service definition template- This is NOT a real service, just a
template!
define service{
name remote-service
use generic-service
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
register 0
}
I've seen something about this on the wiki at
http://wiki.nagios.org/index.php/Howtos:checkbyssh_RedHat but those
commands are more centered around red hat and ssh.
Also tried http://wiki.nagios.org/index.php/Howtos:specific but windows
os isn't listed (unless windows uses same commands as those listed?).
If you could help in any way I'd be most grateful.
If I've missed something out/you need more info please let me know. Thx,
Paul.
Regards,
Paul Singh
IT Support | Bamford & Daylesford Organic | DDI: +44 (0) 207 259 4938 |
Mobile: 07500 607 488
11a West Halkin Street, London SW1X 8JL
Bamford Ltd.
Registered Office: 11A West Halkin Street London, England. SW1X 8JL
Registered No. 4950734 England & Wales
The contents of this Email communication are confidential to the
addressee.
If you are not the intended recipient you may not disclose or distribute
this communication in any form but should immediately contact the
Sender.
The information, images, documents and views expressed in this Email are
personal to the Sender and do not expressly or implicitly represent
official positions and policies of the Bamford group of companies and no
authority exists on behalf of Bamford to make any agreements,
representations or other binding commitment by means of Email.
Certified 100% virus free by Postini
Please consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 220598 bytes
Desc: image001.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4026 bytes
Desc: image002.jpg
------------------------------
------------------------------------------------------------------------
------
Create and publish websites with WebMatrix Use the most popular FREE web
apps or write code yourself; WebMatrix provides all the features you
need to develop and publish your website.
http://p.sf.net/sfu/ms-webmatrix-sf
------------------------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
End of Nagios-users Digest, Vol 58, Issue 22
********************************************
Bamford Ltd.
Registered Office: 11A West Halkin Street London, England. SW1X 8JL
Registered No. 4950734 England & Wales
The contents of this Email communication are confidential to the addressee.
If you are not the intended recipient you may not disclose or distribute this communication in any form but should immediately contact the Sender.
The information, images, documents and views expressed in this Email are personal to the Sender and do not expressly or implicitly represent official
positions and policies of the Bamford group of companies and no authority exists on behalf of Bamford to make any agreements, representations or other
binding commitment by means of Email.
Certified 100% virus free by Postini
Please consider the environment before printing this email.
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and publish
your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
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