nagioscore | Nagios Core | Plugin library
kandi X-RAY | nagioscore Summary
kandi X-RAY | nagioscore Summary
Nagios Core
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nagioscore
nagioscore Key Features
nagioscore Examples and Code Snippets
Community Discussions
Trending Discussions on nagioscore
QUESTION
I'm a Nagios newbie and after reading several doc about hosts, services, commands definitions I came across a pretty dumb error which I can't get pass by.
I followed this tutorial: Official Nagios Tuto
Here is my nagios.cfg code (just a sample, not all the conf):
...ANSWER
Answered 2020-Apr-15 at 07:41Alright, so it was nothing...
Basically I forgot to put the 'use linux-server' in my hosts.cfg so it fails because it misses several mandatory attributes such as max_check_attempts
.
hosts.cfg:
QUESTION
I need a service to be checked three times a day at fixed times. The check should run at 7, 15 and 23 hours (every 8 hours at those times).
What I have tried is define a this time period:
...ANSWER
Answered 2019-Aug-28 at 15:40"When Nagios Core attempts to reschedule a host or service check, it will make sure that the next check falls within a valid time range within the defined timeperiod. If it doesn't, Nagios Core will adjust the next check time to coincide with the next "valid" time in the specified timeperiod."
I was actually feeling pretty sure this wouldn't be the case, but maybe this is a bug if you're seeing a different behavior. I would expect the time periods and the check intervals to create a timing issue that would cause many checks to be dropped. Regardless of how things should work and what is/isn't expected behavior, I wouldn't personally configure it like this. Since you say that:
I need a service to be checked three times a day at fixed times.
Here's what I would do, if I were you:
- I would run this check as a cron job, and send in the result of the check as a passive check command to Nagios. This way, you know for sure that the check will always run on time.
- I would then configure a freshness_threshold to ensure that this passive service has actually phoned home recently.
- I would also configure a
check_command
that prepares for the eventuality of the service not having a fresh result, i.e. something that executes only if no service check has been received -- perhaps a script that re-runs the check and notifies me somehow.
QUESTION
I want to implement a simple health check and make it available via http.
Up to now I have only experience writing nagios plugins. Nagios has this API spec
Is there already a common way how to write vendor-neutral health checks?
If not, what should a sane health check return to make it portable to many different monitoring server implementations?
...ANSWER
Answered 2017-Nov-05 at 08:13Although there is no standard for format of health checks, you should consider major monitoring tools and their expectations from your protocol. In most cases they react to specific HTTP answer codes. For example Amazon Route 53:
waits for an HTTP status code of 200 or greater and less than 400
Another tool, Consul, has more specific definition:
The status of the service depends on the HTTP response code: any 2xx code is considered passing, a 429 Too Many Requests is a warning, and anything else is a failure.
So you might need to check a few top tools you might integrate later and choose an approach suitable for all of them.
QUESTION
I am looking for a spec or an example of how to format the Nagios performance data.
This documentation does not provide any good examples I am looking for an explanation on how to create a table like this in Thruk / Nagios output.
Raw Data :
pending=3;5500;7000 complete=18940;; error=454;;7000
ANSWER
Answered 2017-Oct-23 at 09:52I found this page which describes in some detail how to format the performance data.
This is the expected format:
'label'=value[UOM];[warn];[crit];[min];[max]
Notes:
- space separated list of label/value pairs
- label can contain any characters except the equals sign or single quote (')
- the single quotes for the label are optional. Required if spaces are in the label
- label length is arbitrary, but ideally the first 19 characters are unique (due to a limitation in RRD). Be aware of a limitation in the amount of data that NRPE returns to Nagios
- to specify a quote character, use two single quotes
- warn, crit, min or max may be null (for example, if the threshold is not defined or min and max do not apply). Trailing unfilled semicolons can be dropped
- min and max are not required if UOM=%
- value, min and max in class [-0-9.]. Must all be the same UOM. value may be a literal "U" instead, this would indicate that the actual value couldn't be determined
warn and crit are in the range format (see the Section called Threshold and ranges). Must be the same UOM
UOM (unit of measurement) is one of:
- no unit specified - assume a number (int or float) of things (eg, users, processes, load averages)
- s - seconds (also us, ms)
- % - percentage
- B - bytes (also KB, MB, TB)
- c - a continous counter (such as bytes transmitted on an interface)
It is up to third party programs to convert the Nagios Plugins performance data into graphs.
In my this case the raw data provides a pefect example of the output required.
pending=3;5500;7000 complete=18940;; error=454;;7000
QUESTION
Checking a storage usage issue I have found that nagios generate a huge amount of file writing. Following the issue I made a check about the system calls on centOS 6.8 by strace
...ANSWER
Answered 2017-Apr-05 at 17:05You're using PNP it looks like, which means the actual file that writes the RRD file is in process_perfdata.pl
, not Nagios itself. The function that is doing the writing is called data2rrd
. What you're asking is essentially a limitation of RRDtool.
If this writing seems expensive to you, you may want to look at setting up RRDcached. RRDcached will log all of the writes that need to occur towards RRD files in a specific directory, and then at a specified interval update them all at the same time.
You can also make sure you have enough buffer cache so that all of your RRD file blocks are essentially updated in memory, and changes to disk are less sporadic. You can do this by ensuring you have adequate memory available to the machine.
Also, you can tune your RRD files (or PNP4Nagios - we'll get to that in a second) to store less information so that their overall size is a bit smaller. The trade-off here is that you'll end up with less historical performance data. This may or may not be an issue for you.
You can tune PNP by looking at /usr/local/nagios/etc/pnp/rra.cfg
and /usr/local/nagios/etc/pnp/process_perfdata.cfg
. That is where those files are located on my system, your mileage may vary.
Finally: make sure your system is using the latest version of RRDtool. If you installed via yum
or apt
it may be a bit out of date. I highly recommend compiling from source, as a lot of performance improvements and bug fixes have found their ways in throughout the years.
You can find more information about RRDtool here: http://oss.oetiker.ch/rrdtool/index.en.html
Hope this helps!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nagioscore
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page