Adding services


#1

Hello there,

Can anyone point me how to add windows machine


#2

Hi Madal

This is quite well explained in the nagios documentation. Take a look at nagios.sourceforge.net/docs/3_0/ … ndows.html for an idea of how to get started and if you have any further problems, do come back and post a more specific question and I’m sure many people will be able to help you.

HTH

/S


#3

Thanks for your response, That will help. I am still confused in hosts, groups etc. What i am trying to is this. I want to create three Group called Servers, Printers and Switches. Under server two sub group -like Windows and Linux. Add all windows host to windows group and linux boxs in Linux group. Currently I have nagios 2.13 installed. currently I created hostgroup like this.

define hostgroup{
hostgroup_name servers
alias Windows
members one, two
}

define hostgroup{
hostgroup_name switches
alias switch
members myswitch
}

define hostgroup{
hostgroup_name printers
alias HP
members HP
}

any help would be great!!

Madal


#4

Hi

Yes, it’s a good plan to sort that kind of thing out before you start, keeps it all nice and tidy and much easier to do it now than retrofit it later on! Hostgroups can be members of other hostgroups, so you simply need something like this…

define hostgroup{ hostgroup_name winservers alias Windows Servers members MSone, MStwo } define hostgroup{ hostgroup_name linuxservers alias Linux Servers members RHone, RHtwo } define hostgroup{ hostgroup_name allservers alias All Servers hostgroup_members winservers,linuxservers }

Then, when you come to define your services, you can easily use the hostgroup_name variable in your service definition to target some or all of your server farm, for instance for a ping check you’d probably want that on all servers so you might use hostgroup_name allservers… but for, say, checking drive c: disk space you would clearly limit that to hostgroup_name winservers, for example.

EDIT: I just caught the fact you are using v2 - just wondered if there was a particular reason for using that over v3? Only I’m not entirely sure anything I just wrote is v2 compatible as I don’t use it… !shy

HTH

/S


#5

Thanks, That what I am trying to simplify. My groups are now clean. Can you post similar example for hosts.cfg and services.cfg for above group ? say ping and disk space. At the moment I just used the default template which making me very confusing.hosts.cfg looks like this :

Generic host definitions

define host{
name generic-host ; Generic template name
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

This creates a generic template that any host can use.

Notifies never, checks 15 times before showing critical on CGI interface,

define host{
name servers
use generic-host
check_command check-host-alive
max_check_attempts 15
notification_interval 0
notification_period none
notification_options n
register 0
}

This creates a generic host that your routers can use

monitors host(s) 24x7, notifies on down and recovery, checks 15 times before going critical,

notifies the contact_group every 30 minutes

define host{
name your-routers-host
use generic-host
check_command check-host-alive
max_check_attempts 15
notification_interval 30
notification_period 24x7
notification_options d,r
register 0
}

This creates a generic template that any host can use.

Notifies never, checks 15 times before showing critical on CGI interface,

define host{
name printers
use generic-host
check_command check-host-alive
max_check_attempts 15
notification_interval 0
notification_period none
notification_options n
register 0
}
define host{
use winservers
host_name Test
alias Nagios Test
address 192.168.1.1
contact_groups admins
}

With regard to the version: At the time I installed i used the this command :
yum install nagios nagios-plugins nagios-devel nagios-plugins-nrpe , so it installed all but 2.12 version. When i try to upgrade using upgrade option it says nothing to do. Is there a easy upgrade method ?

Thanks for your help. Being very new in this making me little barrier in understanding but hope i will get into this.

Madal


#6

It’s a little different I think in v2 so I can’t really offer anything useful but to say in v3 you can split up your cfg files into whatever you want, so you can have a templates.cfg, windows.cfg, localhost.cfg, switches.cfg, printers.cfg etc etc all with their own relevant info, makes it a lot easier to keep things neat. So I would be tempted to suggest you have a crack at installing v3 but afaik it is so new it has not been packaged yet so it’s a manual install. That being said however, it’s not that scary to complete - I managed it and I’m hardly an expert by any means… There is even some quick start guides for installation of v3 on the website. IMHO as you are pretty much at the start of your long and happy friendship with Nagios :o , I’d be tempted to do this before instead of going any further with getting the older version up and running - Documentation is really pretty good - have a look at the following links:
Upgrading Nagios: nagios.sourceforge.net/docs/3_0/upgrading.html
Nagios v3 Quickstart guides: nagios.sourceforge.net/docs/3_0/quickstart.html
Nagios v3 documentation TOC: nagios.sourceforge.net/docs/3_0/toc.html
Nagios homepage (inc download area for latest version):http://www.nagios.org

HTH

/S


#7

Hello Strides,

I just installed v3 by following this linkhttp://nagios.sourceforge.net/docs/ … edora.html. looks everything is working however in creating user instead of nagiosadmin i created testuser. when i log into from webinterface it logs in successfully but complains you do not have permission to see this when clicking in hosts details etc. how do i assign permission to user testuser ?

MAdal


#8

Just to let you know that i resolve this issue by chaining username testuser in cgi.cfg instead of nagiosadmin


#9

Hello strides,
I installed client nsclient-- (v 0.3) on one my windows client, I did follow this instruction nagios.sourceforge.net/…itoring-windows.html. and to testing purpose I turned off firewall on nagios server and allowed server to communicate with the client. I do not know where the problem is but nsclient log says it no connection could be made because target machine actively refused it. Any help / idea ?

In my windows.cfg file I added few services and applied to that host. But in nagios shows with RED and critical. It must be because client is not properly configured - am i right ? Forward your advise please

Madal


#10

verify that the firewall is disabled on the windows client and that everything in the NSC.ini file is correct.

also make sure the service is running on the windows client. It doesn’t start automatically after installation.


#11

it worked - i just need sometime for nagios to communicate with the host. After grueling time with nagios now looks like its running the way i wanted.

One more question, As now I disabled the firewall in both client and server - what specific port nagios server and nsclient communicates ? so that i can close all those port except that specific one. could you forward your suggestions ?

MADAL


#12

Hi

Basically, whatever you set it to in nsc.ini - defaults can be seen in the nsclient++ installation documentation:

[blockquote]Firewall

Firewall configuration should be pretty straight forward:

If you use NRPEListener (check_nrpe) you need the NRPE port open (usually 5666) from the nagios server towards the client.

nagios:* -> client:5666

If you use the NSClientListener (check_nt) you need the (modified) NSClient port open (usually 12489) from the nagios server towards the client.

nagios:* -> client:12489

If you use the NSCA Module (passive checks) you need the NSCA port open from the client towards the nagios server.

client:* -> nagios:5667

If you use the NRPEClient module to check any remote systems (use NSClient++ as a proxy) you need to have NRPE port (usually 5666) open from NSClient++ (the proxy) to the remote-client in addition to the method you use to submit the results to the server.

nsclient-proxy:* -> remote-client:5666

All these ports can be changed so check your nsc.ini. [/blockquote]

Rgds

/S


#13

Thanks strides, your help guide me this up and running. Now my nagios is up and running. What I noticed in this system is that I can check all the services in individual host which is sweet.

I have seen system called hobbit which actually tells all the bad message for example like this

"App: E ‘Thu Jul 10 10:03:24 2008’: Userenv - " Windows cannot query for the list of Group Policy objects.
Check the event log for possible messages previously logged by the policy engine that describes the reason
for this. "

Is there a way to see all those error messages in that particular host so i know what the problem is. This will in fact point to exact problem where and what apart from services.

Thanks
MAdal


#14

Hmmm, not that I’ve seen, but I don’t check much windows here so it certainly doesn’t mean such a thing doesn’t exist already as a custom plugin - maybe you should have a look through nagiosexchange.org and see if there is anything you can use or modify - looks like “Hobbit” is parsing the windows event log so I’d begin by searching for that

HTH

/S


#15

Hello strides,

with regard to firewall, I used the NSClientListener (check_nt) on the client. What i have done is open the only that particular port in the server. Do I also open port in client too ?


#16

If there is a firewall on the client, yes.


#17

strides, Thanks. Just let you know - seems working fine. As I have just started with nagios world, I am still tuning up and getting used to this application.

Thanks -
Madal


#18

Hello strides,

I need to monitor few services on XP machine ( i know this is strange), I installed the nsclient++ on these xp machine too and added services. Nagios doesn


#19

Hai all,
Could anybody help me?
Becouse i had installed V3 and host part is working fine and regarding service part i could configure PING, but i need to configure Disk Usage.
Anyones help will be greatfull.

ARjun


#20

Hello arjun,

What type host you are trying to add the services. If this is windows machine then it should be like this.

define service{
use generic-service (depending how you have defined)
host_name your hostname
service_description C:\ Drive Space or the drive you want to monitor
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

this should just work, you can add all the host in hostname line by separating with comma.

Hope this helps,

Madal