Hello
We have nagios configured to send out reports (in PDF format) at the end of every month. However, end user didn't receive last month reports. Though he has received previous months. I can generate reports in nagios GUI but they are within the nagios GUI.
I followed this site and this code to generate report.
http://www.claudiokuenzler.com/blog/117 ... d3BPZeiBJM
wkhtmltopdf --username user1 --password password!T "http://<ip address>/nagios3/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
Notice that we have '!T' in the password. If i run the command as above, i get this error.
-bash: !T: event not found
So i put the password in the 'password!T', it generates the report but within the report i don't see the actual data but message as shown attached.
wkhtmltopdf --username user1 --password password!T "http://<ip address>/nagios3/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
I would like to generate reports for ALL HOSTS and ALL HOSTGROUPS.
Please assist.
Thank you.
MK
Update-
I did a password change to exclue !T but i get the same output file as previoiusly.
Reporting
Re: Reporting
Is this the only user that you do it for? Have you tried with different users?
Former Nagios Employee.
me.
me.
-
- Posts: 28
- Joined: Sun May 31, 2015 3:02 pm
Re: Reporting
Yes, created another user 'mkhan'.
Added this user to the cgi.cfg
restarted apache service, nagios but still see the same output as previously.
Verified that i can access nagios GUI through the new user.
[root@NSV10330 ~]# wkhtmltopdf --username mkhan --password cisco "http://<ip>/nagios/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Question: How can i change this command line to generate report for ALL HOST and HOSTGROUPS. Wondering, may be we can try it?
Thanks.
Added this user to the cgi.cfg
restarted apache service, nagios but still see the same output as previously.
Verified that i can access nagios GUI through the new user.
[root@NSV10330 ~]# wkhtmltopdf --username mkhan --password cisco "http://<ip>/nagios/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Question: How can i change this command line to generate report for ALL HOST and HOSTGROUPS. Wondering, may be we can try it?
Thanks.
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Reporting
You mean an individual report for each host and service right?
You'll have to blow it up on the command line and run the command for each individual object.
You'll have to do some of your own munging to get things in order, but create a list then loop through it.
You'll have to blow it up on the command line and run the command for each individual object.
Code: Select all
[jdalrymple@localhost ~]$ grep host_name /usr/local/nagios/var/objects.cache | sort | uniq | awk '{print $2}'
localhost
netapp
Windows10
Windows11
Windows12
Windows13
Windows14
Windows15
Windows16
Windows17
Windows18
Windows19
Windows2
Windows20
Windows21
Windows22
Windows23
Windows24
Windows25
Windows3
Windows4
Windows5
Windows6
Windows7
Windows8
Windows
[jdalrymple@localhost ~]$ grep service_description /usr/local/nagios/var/objects.cache | sort | uniq | awk '{$1=""; print $0}'
CPU Usage
Current Load
Current Users
Drive C: Disk Usage
Drive D: Disk Usage
em0 Bandwidth
em0 Status
HTTP
Memory Usage
NetApp Uptime
Page File Usage
pflog0 Bandwidth
pflog0 Status
PING
Root Partition
SMTP
SSH
Swap Usage
Total Processes
Uptime
-
- Posts: 28
- Joined: Sun May 31, 2015 3:02 pm
Re: Reporting
Hi
Thanks for the input.
Not the report through command line.
In my previous comment, i mean can we change some parameter (like ones i have bold) in the following command to generate report for HOSTS and HOSTGROUPS if possible. I really don't know what should i change in the this command to accomplish this.
wkhtmltopdf --username mkhan --password cisco "http://<ip>/nagios/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
Regards
MK
Thanks for the input.
Not the report through command line.
In my previous comment, i mean can we change some parameter (like ones i have bold) in the following command to generate report for HOSTS and HOSTGROUPS if possible. I really don't know what should i change in the this command to accomplish this.
wkhtmltopdf --username mkhan --password cisco "http://<ip>/nagios/cgi-bin/avail.cgi?show_log_entries=&host=HOST&service=SERVICE&timeperiod=thismonth" /tmp/report.pdf
Regards
MK
Re: Reporting
Try this for hostgroups. Replace NameofHostgroup with a real name of a hostgroup.
Code: Select all
wkhtmltopdf --username mkhan --password cisco "http://<ip>/nagios/cgi-bin/avail.cgi?show_log_entries=&host=HOST&hostgroup=NameofHostgroup&timeperiod=thismonth" /tmp/report.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!