scripts and templates for nginx

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

Moderators: Developers, Moderators

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

scripts and templates for nginx

Post by umask »

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 14140 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Moving to Scripts and Templates.
Is it possible to provide some screenshots?
Reinhard
umask
Posts: 2
Joined: Thu Mar 20, 2008 5:53 am

Post by umask »

graphs

(my server have low load now).
Attachments
graph_image_nginx_clients_stat.png
graph_image_nginx_clients_stat.png (42.42 KiB) Viewed 56517 times
graph_image_nginx_sockets_stat.png
graph_image_nginx_sockets_stat.png (37.12 KiB) Viewed 56517 times
myfreeke
Cacti User
Posts: 82
Joined: Tue Dec 04, 2007 10:24 pm

Post by myfreeke »

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

Post by kirgudu »

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

Post by 100matolog »

nginx_active:-1 nginx_reading:-1 nginx_writing:-1 nginx_waiting:-1
klim
Posts: 11
Joined: Tue Aug 17, 2010 10:50 pm

Post by klim »

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

Post by bayultimate »

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

Post by exseven »

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

Post by roseqiu »

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

Post by AshleyW »

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

Post by randybonnettes »

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: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: scripts and templates for nginx

Post by netniV »

I believe that percona have decided to drop support for cacti, though when I asked, they never gave me a reason.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: scripts and templates for nginx

Post by Sparkee »

netniV wrote: 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.
Did you ever receive a reply from them?
avasilishin
Posts: 1
Joined: Mon Apr 06, 2020 5:58 am

Re: scripts and templates for nginx

Post by avasilishin »

I just add https
Attachments
get_nginx_socket_status.pl
(1.4 KiB) Downloaded 213 times
get_nginx_clients_status.pl
(1.44 KiB) Downloaded 189 times
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests