scripts and templates for nginx

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
umask
Posts: 2
Joined: Thu Mar 20, 2008 5:53 am

scripts and templates for nginx

#1 Post by umask » Fri Mar 21, 2008 3:34 am

Scripts and templates for nginx.

Nginx - http://nginx.net/

Provide graphing nginx clients statistics (active, reading, writing, waiting) and nginx socket statistics (accepts, handled, requests). It's a formal devision used only for graphs usability.

For use do next steps:

1. Enable nginx http_stub_status_module at configure stage (if requared).

2. Enable stub status. Add to nginx.conf (in any server context):

Code: Select all

location /nginx_status {
	stub_status on;
	# disable access_log if requared
	access_log   off;
	#allow XX.YY.AA.ZZ;
	#allow YY.ZZ.JJ.CC;
	#deny all;
}
Restart nginx.

3.

Code: Select all

cp get_nginx_clients_status.pl <path_cacti>/scripts/
cp get_nginx_socket_status.pl <path_cacti>/scripts/
chmod 0755 <path_cacti>/scripts/get_nginx_socket_status.pl
chmod 0755 <path_cacti>/scripts/get_nginx_clients_status.pl
4. Check that it's work. Run

Code: Select all

get_nginx_clients_status.pl http://nginx.server.tld/nginx_status
and see that returned the same string:

Code: Select all

nginx_accepts:113869 nginx_handled:113869 nginx_requests:122594
5. Import to cacti cacti_graph_template_nginx_clients_stat.xml and cacti_graph_template_nginx_sockets_stat.xml.

6. Add nginx graphs to your hosts.

P.S. Sorry for my english :)
Attachments
cacti-nginx.tar.gz
(5.15 KiB) Downloaded 13177 times

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#2 Post by gandalf » Fri Mar 21, 2008 10:51 am

Moving to Scripts and Templates.
Is it possible to provide some screenshots?
Reinhard

umask
Posts: 2
Joined: Thu Mar 20, 2008 5:53 am

#3 Post by umask » Sat Mar 22, 2008 1:58 am

graphs

(my server have low load now).
Attachments
graph_image_nginx_clients_stat.png
graph_image_nginx_clients_stat.png (42.42 KiB) Viewed 48646 times
graph_image_nginx_sockets_stat.png
graph_image_nginx_sockets_stat.png (37.12 KiB) Viewed 48646 times

myfreeke
Cacti User
Posts: 82
Joined: Tue Dec 04, 2007 10:24 pm

#4 Post by myfreeke » Thu May 15, 2008 12:15 am

Hey umask


I Import xml error:

Error: XML: Hash version does not exist.

kirgudu
Posts: 10
Joined: Wed Feb 04, 2009 4:22 am
Location: Moscow, Russia

#5 Post by kirgudu » Fri Apr 03, 2009 7:17 am

works fine, thank's!

100matolog
Posts: 41
Joined: Sun Dec 20, 2009 3:15 am
Location: Kiev

nginx_active:-1 nginx_reading:-1 nginx_writing:-1 nginx_wait

#6 Post by 100matolog » Fri Apr 23, 2010 3:16 am

nginx_active:-1 nginx_reading:-1 nginx_writing:-1 nginx_waiting:-1

klim
Posts: 11
Joined: Tue Aug 17, 2010 10:50 pm

#7 Post by klim » Mon Aug 30, 2010 1:13 am

Hmm.. what about status codes (404, 503 and etc...)
Is template exist or need to development?

bayultimate
Posts: 1
Joined: Thu May 03, 2012 9:33 pm

Re: scripts and templates for nginx

#8 Post by bayultimate » Thu May 03, 2012 9:34 pm

when i want to try run the command ./get_nginx_clients_status.pl http://myweb.com/nginx_status, this notification appear: no (LWP::UserAgent not found) , am i doing wrong in some place?

exseven
Posts: 13
Joined: Tue Jun 24, 2008 9:57 am

Re: scripts and templates for nginx

#9 Post by exseven » Mon May 07, 2012 12:19 pm

bayultimate wrote:when i want to try run the command ./get_nginx_clients_status.pl http://myweb.com/nginx_status, this notification appear: no (LWP::UserAgent not found) , am i doing wrong in some place?
Install the LWP::UserAgent perl module

roseqiu
Posts: 2
Joined: Tue Oct 23, 2012 2:12 am

Re: scripts and templates for nginx

#10 Post by roseqiu » Tue Oct 23, 2012 2:19 am

The sh/exec functionality appears to have been removed from the ubuntu distributions in favor of keyword extend. Extend also isn't a drop in replacement, the OID's get fairly screwy and the trick of executing the netstat calls in the background no longer works which can hang cacti.http://www.freerun-tn-au.com/

AshleyW
Posts: 6
Joined: Tue Jul 09, 2013 10:34 am

Re: scripts and templates for nginx

#11 Post by AshleyW » Tue Jul 09, 2013 10:35 am

I am getting -nan for my graphs.

Script works:
./get_nginx_clients_status.pl http://192.168.1.1/nginx_status
nginx_active:1 nginx_reading:0 nginx_writing:1 nginx_waiting:0

User avatar
randybonnettes
Posts: 1
Joined: Wed Jun 26, 2019 12:53 am

Re: scripts and templates for nginx

#12 Post by randybonnettes » Wed Jun 26, 2019 12:57 am

roseqiu wrote:
The sh/exec functionality appears to have been removed from the ubuntu distributions in favor of keyword extend. Extend also isn't a drop in replacement, the OID's get fairly screwy and the trick of executing the netstat calls in the background no longer works which can hang cacti.http://www.freerun-tn-au.com/
Hi,

Any experience with Percona Nginx monitoring template for Cacti? The resource is not available - https://www.percona.com/doc/percona-mon ... lates.html

netniV
Cacti Guru User
Posts: 3061
Joined: Sun Aug 27, 2017 12:05 am

Re: scripts and templates for nginx

#13 Post by netniV » Mon Jul 01, 2019 5:12 pm

I believe that percona have decided to drop support for cacti, though when I asked, they never gave me a reason.

Post Reply