Hello,
Is there a way to add service check through command line in NagiosXI?
Need to add below service check in around 300 servers and it is little hard to do through GUI.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H xxxx.domain.com -t 30 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Any help on this would be much appreciated.
Add service check via command line
Re: Add service check via command line
I'm not sure if this is what you're looking for, but you can create a configuration file that contains whatever you need and move it to /usr/local/nagiosxi/import then:
Nagios will import that into the XI configuration.
Code: Select all
cd /usr/local/nagiosxi/scripts
sh reconfigure_nagios.shEric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add service check via command line
Or you can use the process outlined in this document to create hosts/services
http://assets.nagios.com/downloads/nagi ... gement.pdf
http://assets.nagios.com/downloads/nagi ... gement.pdf
Re: Add service check via command line
If I am reading this correctly... These solutions would worksureshkraj2012 wrote:Hello,
Is there a way to add service check through command line in NagiosXI?
Need to add below service check in around 300 servers and it is little hard to do through GUI.
COMMAND: /usr/local/nagios/libexec/check_nrpe -H xxxx.domain.com -t 30 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Any help on this would be much appreciated.
1. Create a hostgroup with the 300 servers and then associate your service check to the hostgroup. {recommended}
2. Create flat files for these configurations and store them in /usr/local/nagios/etc/static
3. Create flat files and import everything over using the above methodology.
I'm a big proponent of keeping things simple which is why I would go with option 1 personally.
Cheers
----------------------
Nagios Jedi in training.
Nagios Jedi in training.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Add service check via command line
Correct.technick wrote:If I am reading this correctly... These solutions would work
1. Create a hostgroup with the 300 servers and then associate your service check to the hostgroup. {recommended}
2. Create flat files for these configurations and store them in /usr/local/nagios/etc/static
3. Create flat files and import everything over using the above methodology.
I'm a big proponent of keeping things simple which is why I would go with option 1 personally.
Cheers
Then anytime you add a host to the hostgroup they will automatically get all the services that have this hostgroup associated.
This is really the ideal setup if you always monitor the same items on a group of servers and they all have the same settings (thresholds, etc).
this is something to think about, because changing the warning/critical threshold on the service definition, will change it for ALL of the hosts. In many cases this is desirable, in some it is not...
-
sureshkraj2012
- Posts: 65
- Joined: Tue Aug 06, 2013 11:06 pm
Re: Add service check via command line
Thank you for your valuable solutions!
I would like to append this (checkMEM) service check via command line along with other service check (CPU, disk etc..,) that are already configured.
/usr/local/nagios/libexec/check_nrpe -H xxxx.domain.com -t 30 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Also, could you please elaborate on flat file and it would be great if example provided?
I would like to append this (checkMEM) service check via command line along with other service check (CPU, disk etc..,) that are already configured.
/usr/local/nagios/libexec/check_nrpe -H xxxx.domain.com -t 30 -c CheckMEM -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Also, could you please elaborate on flat file and it would be great if example provided?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Add service check via command line
Creation and use of the static flat config files in XI is covered here:
http://assets.nagios.com/downloads/nagi ... _Files.pdf
For some examples please take a look at the "How to monitor" sections here:
http://nagios.sourceforge.net/docs/3_0/toc.html
You can also see all of the flat config file versions of what you have in your XI server's database for hosts and services in:
http://assets.nagios.com/downloads/nagi ... _Files.pdf
For some examples please take a look at the "How to monitor" sections here:
http://nagios.sourceforge.net/docs/3_0/toc.html
You can also see all of the flat config file versions of what you have in your XI server's database for hosts and services in:
Code: Select all
/usr/local/nagios/etc/hosts/
/usr/local/nagios/etc/services/