Jump to content

does anybody use Nagios here, i need help regarding check_snmp to monitor Server


Recommended Posts

Posted

Hi, I am trying to monitor Windows Server 2003 CPU, Disk, Memory with Nagios without using its agent. I am trying to use it with check_snmp where i need OID.

where do i get the oid to monitor cpu, disk, memory for windows server 2003/2008.

Or how do i get it? is there any tool for windows to get oid?

 

so far i have only got one which gives System Uptime

./check_snmp -H 172.20.10.10 -o .1.3.6.1.2.1.1.3.0 -C public

 

 

 

 

you help will be appreciated.

Posted

You don't need the OIDs or to even use check_snmp for WIndows...

Get the NSclient++ installed & configured on the servers and make sure you have the check_nt plugin for Nagios

 

I'll dig out a sample NSClient config and a config from Nagios...

Posted
Hi, I am trying to monitor Windows Server 2003 CPU, Disk, Memory with Nagios without using its agent.

 

I take it that means you are trying to do it without the nsclient+ plugin?

 

May I ask why you dont want to use it?

Posted
I take it that means you are trying to do it without the nsclient+ plugin?

 

May I ask why you dont want to use it?

 

D'oh! never saw that bit!

 

Seems a bit bizarre not to use the agent - it does make it a lot easier to monitor the CPU, Mem usage, Windows Services, etc..

 

It would appear that it may not be possible to do this without the agent.. Monitoring Windows Machines

Posted

NSClient++

in-terms of resources (memory), does it takes lots of resources or not, if not then i will definitely try using it.

 

thanks to everybody

 

Also what about for printers?

We have variety of printers from HP, Brother, Kyocera.

Posted

it uses nothing. couple of meg install is all it is if that.

 

I started monitoring printers but then it became a PITA. Teachers would turn them off now and then, we would get too many warnings about toner and the teachers not ocming to get any, etc. So we stopped. IF they need toner they know where they can swap their empty one with a new one.

 

But to answer your question, there are various plugins for various printers. Check NAgios Exchange or whatever its called

Posted

I use check_printer for monitoring our printers

Bit trial and error to get the OIDs right for each printer

 

If needed I can zip the plugin and some sample configs...

Posted
NSClient++

in-terms of resources (memory), does it takes lots of resources or not, if not then i will definitely try using it.

 

thanks to everybody

 

Also what about for printers?

We have variety of printers from HP, Brother, Kyocera.

 

check_printer works on Brothers, Kyoceras, HP, Konica-Minolta Bizhubs and Olivetti copiers (can vary greatly on the latter though)

 

check_hpjd works on HP printers and can give slightly more HP-specific info.

 

To echo what RabbieBurns said - choose your printer notifications carefully. We only alert between 8:45-3:45 and Nagios isn't configured to page on anything but the reports printer. If you have scheduled shutdowns of printers, don't count it in uptime stats.

Posted
I use check_printer for monitoring our printers

Bit trial and error to get the OIDs right for each printer

 

If needed I can zip the plugin and some sample configs...

 

Hi Gatt,

I will be grateful if you could pass me your sample configs and plugin please.

 

Thanks everybody

Posted
[ATTACH=CONFIG]10621[/ATTACH]

 

Here you go mate

 

Any problems let me know :)

 

thanks Gatt,

 

this is the hierachy of the /usr/local/nagios/etc in my nagios installation

 

objects

|

|

printers

|

bro-5250-01.cfg

bro-5250-01.cfg

bro-5250-02.cfg

hp-4700-01.cfg

 

 

 

objects

|

|

servers

|

dc01.cfg

dc02.cfg

exch01.cfg

printsvr.cfg

ts01.cfg

ts02.cfg

 

 

 

objects

|

|

commands.cfg

contacts.cfg

localhost.cfg

printer.cfg

switch.cfg

templates.cfg

timeperiods.cfg

windows.cfg

 

 

 

 

hav i setup the monitoring for servers & printers in a correct way?

Also the windows.cfg has some default configuration which displays "winserver" in the nagios page. Is there anyway i can ignore this windows.cfg, i tried deleting it but it doesnt works.

 

thanks

Posted

What problems / errors are you getting with the windows.cfg?

 

Mine looks like this :

 

# Windows host definition template - This is NOT a real host, just a template!
define host{
name                    windows-server  ; The name of this host template
use                     generic-host    ; Inherit default values from the generic-host template
check_period            24x7            ; By default, Windows servers are monitored round the clock
check_interval          5               ; Actively check the server every 5 minutes
retry_interval          1               ; Schedule host check retries at 1 minute intervals
max_check_attempts      10              ; Check each server 10 times (max)
check_command           check-host-alive        ; Default command to check if servers are "alive"
notification_period     24x7            ; Send notification out at any time - day or night
notification_interval   30              ; Resend notifications every 30 minutes
notification_options    d,r             ; Only send notifications for specific host states
contact_groups          admins          ; Notifications get sent to the admins by default
hostgroups              windows-servers ; Host groups that Windows servers should be a member of
register                0               ; DONT REGISTER THIS - ITS JUST A TEMPLATE
}

 

And one of my Windows Servers looks like this:

 

###############################################################################
# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
#
# Last Modified: 06-13-2007
#
# NOTES: This config file assumes that you are using the sample configuration
#     files that get installed with the Nagios quickstart guide.
#
###############################################################################




###############################################################################
###############################################################################
#
# HOST DEFINITIONS
#
###############################################################################
###############################################################################

# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation

define host{
   use        windows-server    ; Inherit default values from a template
   host_name    apps01    ; The name we're giving to this host
   alias        Application Server    ; A longer name associated with the host
   address        w.x.y.z    ; IP address of the host
   }




###############################################################################
###############################################################################
#
# HOST GROUP DEFINITIONS
#
###############################################################################
###############################################################################


# Define a hostgroup for Windows machines
# All hosts that use the windows-server template will automatically be a member of this group

#define hostgroup{
#    hostgroup_name    windows-servers    ; The name of the hostgroup
#    alias        Windows Servers    ; Long name of the group
#    }




###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################


# Service definition to ping the switch using check_ping
define service{
   use                     generic-service
   hostgroup_name          windows-servers
   service_description     Remote Desktop Service
   check_command           check_nt!SERVICESTATE!-d SHOWALL -l TermService
   normal_check_interval   5
   retry_check_interval    1
}

# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    NSClient++ Version
   check_command        check_nt!CLIENTVERSION
   }



# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    Uptime
   check_command        check_nt!UPTIME
   }



# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    CPU Load
   check_command        check_nt!CPULOAD!-l 5,80,90
   }



# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    Memory Usage
   check_command        check_nt!MEMUSE!-w 80 -c 90
   }



# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    C:\ Drive Space
   check_command        check_nt!USEDDISKSPACE!-l c -w 80 -c 90
   }



# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    W3SVC
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
   }

# Create a service for monitoring the LogMeIn process
# Change the host_name to match the name of the host you defined above

define service{
   use            generic-service
   host_name        apps01
   service_description    Netlogon
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l Netlogon
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    SQL Server
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    RPC Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l RpcSs
   }

# Following Services relate to Configuratuion Manager

define service{
   use            generic-service
   host_name        apps01
   service_description    SMS Executive Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l SMS_EXECUTIVE
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    SMS_REPORTING_POINT Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l SMS_REPORTING_POINT
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    SMS_SITE_COMPONENT_MANAGER Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l SMS_SITE_COMPONENT_MANAGER
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    SMS_SITE_SQL_BACKUP Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l SMS_SITE_SQL_BACKUP
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    SMS_SITE_VSS_WRITER Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l SMS_SITE_VSS_WRITER
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    AI_UPDATE_SERVICE_POINT Service
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l AI_UPDATE_SERVICE_POINT
   }

define service{
   use            generic-service
   host_name        apps01
   service_description    Windows Deployment Services Server
   check_command        check_nt!SERVICESTATE!-d SHOWALL -l WDSServer
   }

 

 

Also, check your hostgroups.cfg file as well

 

Your hierarchy looks fine btw...

 

Whats the output if you run this command?

 


/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

(Change paths as appropriate, but i suspect that is the corect one for you...

  • Thanks 1
Posted

basically all my servers cfg are in Servers folder and i want to avoid using this default windows.cfg. Right now windows.cfg has default config been setuped automatically by nagios installation.

 

if i remove windows.cfg, the "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" scripts gives error saying "Error open config file windows.cfg fore reading......"

 

Unless i put one of my domain controller settings on this file.

 

I just wanted all my server cfg to be in server folder and printer cfg to be in printer folder.

 

 

Thanks gatt.

Posted

I think that windows.cfg file needs to be there, but I dont have anything in it as it just acts as a definition template for certain key info (Notifications, Hostgroups, etc..)

My server folder contains a config file for each server I want to check and each one of them has a list of what I want to check

Posted

hi gatt,

somehow i dont have hostgroups.cfg. but my nagios works fine:

 

is it necessary to create .cfg file for each hosts with all the services. Isnt there anyway where we can have a single cfg file with list of services and another file for each host which will pull the services details from the services cfg file.

 

currently i have something like this:

 

host1.cfg

define host

define service a

define service b

define service c

define service d

define service e

define service f

define service g

 

 

host2.cfg

define host

define service a

define service b

define service c

define service d

define service e

define service f

define service g

 

 

host3.cfg

define host

define service a

define service b

define service c

define service d

define service e

define service f

define service g

 

 

host4.cfg

define host

define service a

define service b

define service c

define service d

define service e

define service f

define service g

Posted

Yes and no..

You can setup "generic" services linked to a hostgroup, that way any server assigned that hostgroup will automatically monitor those services.

 

See: HowTos/Nagios - CentOS Wiki

 

However.. I that these override any similar definitions - classic example was with HTTP! if I defined it to monitor port 80, i could not change one server to monitor port 8080!

 

You still, however, need to create a config file for each server you want to monitor and add it to the hostgroup - there is no getting out of that one I'm afraid.

 

The advantage of using generic services is that all you need in your serverXX.cfg files is the hostname, alias and IP address and any additonal services you want to monitor.

 

I, personally, found it easier to put everything in the serverXX.cfg file and copy/paste/edit as needed....

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...