Nagios Question
Hey guys,
I need help, this is probably quite easy but since i am a nagios newbie then it's not so much. I have setup nagios on Fedora 11 and have installed the nsclient++ on a number of workstations and monitoring the usual services that's working fine alerts and all. However, I want to be able to monitor the event logs and have nagios send a notification if there is a warning or critical error generated. Can anyone suggest how i go about getting that configured? Any assistance with this would surely be appreciated. Thanks. |
Hello,
There are various ways to check the eventlogs using Nagios. Have a look at these plugins from NagiosExchange. Kind regards, Eric |
Thanks Eric.
Some of these plugins require an additional agent. I was hoping to leverage the already installed NSClient++. I see the nsc.ini has the eventlog.dll enabled so i believe i should be able to use this agent. However, i have no clue how to configure Nagios to do so. |
You're welcome, I'm not at work right now so I cannot look into it at the moment. I do have some Windows servers with NSClient installed running some of those plugins if I'm not mistaking. I'll check tomorrow and let you know. I mostly use the NRPE daemon (which works also great with Windows, running as a service) and those plugins work perfect with that daemon for sure. I'll get back to you tomorrow on the NSClient thing though.
Kind regards, Eric |
Hmm, the nsc.ini also has the nrpe.dll listed and i have the nrpe plugin loaded on the nagios server......
|
Hello,
It should work if you have the correct scripts in place and configured the NSClient correctly. I just checked my servers and although I still have NSClient installed on various servers I seem to already have migrated all checks to NRPE. Kind regards, Eric |
ok, can you help me with setting up nrpe on the windows servers then? I already have it installed on nagios server.
|
Hi,
That's easy enough. Download NRPE_NT from here. It's a zip file. In it there's a document named INSTALL. Quote:
Code:
nrpe_nt -i Remember though that after every change to the nrpe.cfg file, you'll have to restart the service, if I'm not mistaking. Kind regards, Eric |
http://funlinuxfun.blogspot.com/
How to setup Nagios Server on Redhat http://funlinuxfun.blogspot.com/ 1. Don't install nagios using RPM,instead download the source code tarballs of both Nagios and the Nagios plugins (visit http://www.nagios.org/download/ for links to the latest versions). wget http://osdn.dl.sourceforge.net/sourc...s-3.0.3.tar.gz wget http://osdn.dl.sourceforge.net/sourc...-1.4.11.tar.gz 2. Create Account Information Become the root user. su -l 3. Create a new nagios user account and give it a password. /usr/sbin/useradd -m nagios passwd nagios 4. Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the Apache user to the group. /usr/sbin/groupadd nagcmd /usr/sbin/usermod -G nagcmd nagios /usr/sbin/usermod -G nagcmd apache 5. Extract the Nagios source code tarball. cd ~/downloads tar xzf nagios-3.0.3.tar.gz cd nagios-3.0.3 Run the Nagios configure script, passing the name of the group you created earlier like so: ./configure --with-command-group=nagcmd 6. Compile the Nagios source code. # make all Install binaries, init script, sample config files and set permissions on the external command directory. # make install # make install-init # make install-config # make install-commandmode 7. Customize Configuration Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed... Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts. vi /usr/local/nagios/etc/objects/contacts.cfg 8. Configure the Web Interface Install the Nagios web config file in the Apache conf.d directory. make install-webconf root@lvs2 nagios-3.0.3]# make install-webconf /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf 8. Create a nagiosadmin account for logging into the Nagios web interface. htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin Restart Apache to make the new settings take effect. service httpd restart 9. Compile and Install the Nagios Plugins Extract the Nagios plugins source code tarball. cd ~/downloads tar xzf nagios-plugins-1.4.11.tar.gz cd nagios-plugins-1.4.11 10. Compile and install the plugins. ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install Start Nagios 11. Add Nagios to the list of system services and have it automatically start when the system boots. chkconfig --add nagios chkconfig nagios on Verify the sample Nagios configuration files. /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg If there are no errors, start Nagios. service nagios start 12. Object configuration files As mentioned, when the configuration files are split up, Nagios reads the data from these files in order for it to process host and service checks across the network. Before I begin, detailed documentation of all of the options for the template based objects are located at the website. # cd /usr/local/nagios/etc/objects/ # touch hostgroup.cfg hosts.cfg services.cfg # vi localhost.cfg Copy the Services Definitions # vi services.cfg Paste the Services Definitions #vi localhost.cfg Copy the Host Definitions #vi hosts.cfg Paste the Host Definitions #vi localhost.cfg Copy the Host Definitions # vi hostgroup.cfg Paste the hostgroup Definitions Setting up nagios.cfg [me@rhel ~] cd /etc/nagios [me@rhel nagios] mv localhost.cfg localhost.cfg_org Turn on the allow commands to be executed from the CGI web interface. [me@rhel nagios] vi nagios.cfg # OBJECT CONFIGURATION FILE(S) cfg_file=/etc/nagios/contacts.cfg cfg_file=/etc/nagios/hostgroups.cfg cfg_file=/etc/nagios/hosts.cfg cfg_file=/etc/nagios/services.cfg cfg_file=/etc/nagios/timeperiods.cfg # EXTERNAL COMMAND OPTION check_external_commands=1 # EXTERNAL COMMAND CHECK INTERVAL command_check_interval=1 I have my sample config to download:http://www.turboupload.com/files/get...mpleconfig.odt |
Thanks guys i will try to see if i can get nrpe up and running. Don't be too suprised to see more dumb questions... Eric what about this download winrpe?
http://itefix.no/i2/winrpe |
Why would you install that? Any particular reason? The first reason I wouldn't install it on one of my servers is the 'extras' that it comes with:
Quote:
But, I've never tried it (winrpe that is; nor will I do so) so I cannot tell you about it. Kind regards, Eric |
I agree, ok i have the NRPE installed as per your instructions on a test box. I now have to go about defining commands i guess. I can run command line and get back a response so that looks good.
|
That's indeed a good thing, means you got that one working.
Kind regards, Eric |
Eric,
Can i impose upon you to show me an example of a command definition and a service definition that works for you? Can't seem to get the definitons right.....arrghh why is it so hard to do this.....nsclient is way easier!!! |
Hello,
Of course you can impose for that ;) On my Windows servers I have the WMI plugins installed (download here). Those use the Microsoft .NET framework and are pretty easy and straightforward. The setup and usage however is very similar so you should be able to find your way. Using NRPE you can go two ways, use arguments or don't allow the use of arguments. If you don't allow it, then you'll have to hardcode all parameters to the command in the nrpe.cfg file (like I do since it's more secure not to allow arguments). A command description in nrpe.cfg would look like this: Code:
command[get_cpu]=cscript.exe //nologo //T:60 c:\nrpe_nt\plugins\v2\check_cpu_load_percentage.vbs -h localhost -inst "*" -w 80 -c 90 On the Nagios side I use the GroundWork installation, so everything is handled through a very nice web interface. The command created on Nagios shows like this in the check_commands.cfg file: Code:
define command { Code:
check_nrpe -t 60 -H 172.25.2.18 -c get_cpu Kind regards, Eric |
All times are GMT -5. The time now is 05:19 PM. |