Page 1 of 2
Help with Reports
Posted: Wed Sep 16, 2015 2:06 pm
by cliftondasilva
Hey all,
Not sure if this was answered in another post. I'm trying to get an executive summary of all the disk spaced used on all our machine monitored by NAGIOS. Is there a plugin or a way to get an Executive Summary of Disk usage throughout all machines monitored by NAGIOS? I'm currently running Nagios XI 2014R2.7
Any help with getting this will be greatly appreciated!!! or pointing me to the right direction.
Re: Help with Reports
Posted: Thu Sep 17, 2015 10:04 am
by jdalrymple
Depends - we have our metrics component which can do a pretty good job of aggregating disk usage for certain service types, but not all. For example (today) we cannot add in disk space gathered using an SNMP check. It's basically just the stuff gathered using NRPE (Linux Server wizard) and NSCP (Windows Server wizard). If you used those wizards for everything, you should be able to get what you want.
If this doesn't suit your needs, the best answer I have to offer is that we're looking to expand the usefulness of that component in the future, but I know of no better way to achieve your goal today.
Re: Help with Reports
Posted: Mon Sep 28, 2015 8:47 am
by cliftondasilva
thanks for the update. I'm currently trying to run a script that will do this for us but haven't been successful yet.
Re: Help with Reports
Posted: Mon Sep 28, 2015 9:02 am
by scottwilkerson
If all the checks have the same service_description, you can get them from the Backend API URL component
Admin -> Manage Components ->Backend API URL Component -> Edit
Select User
Copy URL for "Current Service Status"
Then, append "&service_description=<YOUR_SERVICE_DESCRIPTION>"
This will filter the XML down to just services that match your description
Re: Help with Reports
Posted: Mon Sep 28, 2015 6:57 pm
by gormank
I tried that w/ wget and all I got back was authentication error in the saved file. Works fine manually though. I added &password=<correct password> but still no luck. Any hints?
Recent data is also in the DB and is easy to get to via script. I just made a cheesy subroutine in perl to run the sql but would look into DBI once I get the concept worked out.
# mysql
mysql> use nagios
mysql> select name1 Hostname, name2 'Service Name', current_state Status, status_update_time 'Check Time', perfdata 'Performance Data' from nagios_objects, nagios_servicestatus where object_id = service_object_id and is_active = 1 and name2 like 'FS_Win_Usage' order by name1, name2;
https://assets.nagios.com/downloads/nag ... _Model.pdf
Re: Help with Reports
Posted: Tue Sep 29, 2015 11:04 am
by lmiltchev
I tried that w/ wget and all I got back was authentication error in the saved file. Works fine manually though. I added &password=<correct password> but still no luck. Any hints?
Can you show us the command that you tried? Hide sensitive info.
Re: Help with Reports
Posted: Tue Sep 29, 2015 4:49 pm
by gormank
In a browser this works as you said:
https://host/nagiosxi/backend/?cmd=gets ... _Unix_Load
But using a browser defeats the purpose of automating things.
I tried with and without --no-check..., as http/https, and tried curl with the same result.
[root@txslm2mlnag001 services]# wget --no-check-certificate
https://txslm2mlnag001/nagiosxi/backend ... _Unix_Load
[1] 13193
[2] 13194
[3] 13195
[root@txslm2mlnag001 services]# --2015-09-29 21:43:16--
https://txslm2mlnag001/nagiosxi/backend ... vicestatus
Resolving txslm2mlnag001... 10.133.134.84
Connecting to txslm2mlnag001|10.133.134.84|:443... connected.
WARNING: cannot verify txslm2mlnag001’s certificate, issued by “/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=nagiosxi.verizon/emailAddress=
[email protected]”:
Self-signed certificate encountered.
WARNING: certificate common name “nagiosxi.verizon” doesn't match requested host name “txslm2mlnag001”.
HTTP request sent, awaiting response... 200 OK
Length: 108 [text/xml]
Saving to: “index.html?cmd=getservicestatus”
100%[============================================================================================================================>] 108 --.-K/s in 0s
2015-09-29 21:43:17 (6.18 MB/s) - “index.html?cmd=getservicestatus” saved [108/108]
[1] Done wget --no-check-certificate
https://txslm2mlnag001/nagiosxi/backend ... vicestatus
[2]- Done username=nagiosadmin
[3]+ Done ticket=-----
[root@txslm2mlnag001 services]# cat index.html\?cmd\=getservicestatus
<?xml version="1.0" encoding="utf-8"?>
<error>
<errormessage>Authentication Failure</errormessage>
</error>
Re: Help with Reports
Posted: Wed Sep 30, 2015 1:12 pm
by jomann
When you do the wget command you need to put the entire URL in quotes " "
Re: Help with Reports
Posted: Thu Oct 01, 2015 2:50 pm
by gormank
You're right. That made it work.
Thanks!
Re: Help with Reports
Posted: Thu Oct 01, 2015 2:52 pm
by hsmith
Is this one all right to mark resolved?