has anyone from you pulled server hardware data from Nagios to build an inventory? Basically I am trying to create an inventory of an existing servers and hardware components monitored with nagios (i.e. hostname, CPU, MEM, HDD and etc.) There are other ways to do it, but maybe there is a plugin or a way to pull it directly from nagios?
Thanks
You could run this on the command line against your configuration files:
grep "host_name" /usr/local/nagios/etc/objects/hosts.cfg >>output.log
That will output a list of all parameters associated with the host_name line within your configuration.
There is a new mk_inventory plugin for nagios which will pull HW info from the machine
Related
I have a linux system with systemd 237. I need to get the list of NTP servers configured by DHCP using C code.
The sources of systemd has all the informations:
/* Get NTP entries for a given link. These are domain names or string
* representations of IP addresses */
int sd_network_link_get_ntp(int ifindex, char ***ret);
(from sd-network.h)
But this interface isn't exposed in libsystemd.
I know that the latest systemd expose a dbus interface with the necessary informations, but I can't update it.
The /etc/ntp.conf isn't filled anymore.
The files under /run/systemd/netif aren't filled until networkctl is run and, even though, the files generated contains an explicit line at the start:
# This is private data. Do not parse.
If anyone has a solution.
Thank you
Hi I have just installed a clean copy of Nagios and Check_MK. But I don't understand how they work together. Nagios uses nrpe to connect to clients and performs checks. This means that some Nagios plugins have to sit on the client and return results from when they are called. But how does Check_MK tie into Nagios. Does it use check_mk_agent to replace all the Nagios plugins to perform its checks? Also does the Nagios configurations all have to be fully configured with all the clients already in place to be checked and then ported to Check_MK interface (wato) or can the clients be added to Check_MK without being present in the Nagios configurations. This is where my confusion lies and I cant find a concrete answer to this question anywhere. Please help.
Check_MK uses Nagios core for theses tasks:
Manage Check results
Triggering of alarms
Manage planned downtimes
Test host availability
Detect network failures
As you can see at the bottom of this page: http://mathias-kettner.com/checkmk_monitoring_system.html
Check_MK needs both: client side monitoring agent and server side monitoring system.
The server side monitoring system calls the agent of the host and passes the check results to the monitoring core (usually Nagios but there is also an new core just for Check_MK).
What makes Check_MK different from other passive Checks (like NRPE) is that the results for all checks is send to the monitoring system in one package. If you run the agent on a host in a shell it will return something like this:
➜ ~ check_mk_agent
<<<df>>>
/dev/mapper/MyStorage-rootvol ext4 15350768 13206900 1341052 91% /
dev devtmpfs 4022348 0 4022348 0% /dev
plus many more lines ....
So the server side part of Check_MK splits these packages into single checks so that the Nagios core can handle them.
So Check_MK wont replace your existing checks, it doesn't care about them. It will just add more.
You don't necessary need WATO to configure Check_MK. WATO is just an interface for the configuration. Configuration can also be done with plain text files. You should start with WATO and take a look at the configuration it has generated.
I want to create metric that show the current CPU Usage on a host.
Metric that I want is like on the Ganglia (gweb)
How I can build that?
If the host is Linux/UNIX you could install NRPE on the monitored host, then use check_nrpe to remotely run the check_cpu plugin.
If the host is windows, you could install NC_Net on the monitored host, then use check_nt to query the CPU usage.
If the host is SNMP-capable, you could use check_snmp to query the CPU OID , either 1.3.6.1.4.1.2021.11.11.0 (NET-SNMP) or 1.3.6.1.4.1.9.2.1.58.0 (HOST-MIB)
If the host is a VMware guest, then you need to query the VirtualCentre. Check on monitoringexchange.org for the check_vmware plugin.
This will allow Nagios to alert based on CPU usage thresholds. To obtain graphs and so on (as in Ganglia) you will need to add something like pnp4nagios to graph the perfstats.
I want monitor my ntpd services and ntpd service is used udp protocol。nagios have a method that is named check_udp,As follows:
[root#localhost]# ./check_udp -H 127.0.0.1 -p 123
With UDP checks, a send/expect string must be specified.
I want to know how to use check_udp...
I suggest saving yourself some effort and use one of the many NTP nagios plugins like the one below from the official nagios plugins package.
http://nagiosplugins.org/man/check_ntp_peer
I am trying to find the location of the database where a particular website is saving to.
The website is saving to some local database in our system, but I am unable to discover where.
I have tried using WireShark to find the IP of the machine where the website sends data to (i.e. the machine which has the database) but currently the only packets showing up are those from the website to my machine and vice versa.
Any ideas?
Thanks
I would start by tracking through the code & website config. If you have sufficient access to run Wireshartk on the host can you not search for config files, find the serverside code, etc?
If you can't see packets on the network interface and you know you've found all network interfaces then it would appear possible the DB has to be on the same machine. Check for recently changed files with you favourite tool (Windows explorer/search, find on Unix, etc).
Is it caching so you haven't yet caused it to read/write to a remote DB while watching? Try watching Wireshark at boot up.
Depending on the nature of the data it could be an in memory DB or something that reads from a disk file into memory at boot up.