Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Aug 19, 2017 9:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: scripts and templates for nginx
PostPosted: Fri Mar 21, 2008 3:34 am 
Offline

Joined: Thu Mar 20, 2008 5:53 am
Posts: 2
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:
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:
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:
get_nginx_clients_status.pl http://nginx.server.tld/nginx_status


and see that returned the same string:

Code:
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 12406 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 10:51 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Moving to Scripts and Templates.
Is it possible to provide some screenshots?
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 22, 2008 1:58 am 
Offline

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

(my server have low load now).


Attachments:
graph_image_nginx_sockets_stat.png
graph_image_nginx_sockets_stat.png [ 37.12 KiB | Viewed 44482 times ]
graph_image_nginx_clients_stat.png
graph_image_nginx_clients_stat.png [ 42.42 KiB | Viewed 44482 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2008 12:15 am 
Offline
Cacti User

Joined: Tue Dec 04, 2007 10:24 pm
Posts: 82
Hey umask


I Import xml error:

Error: XML: Hash version does not exist.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 7:17 am 
Offline

Joined: Wed Feb 04, 2009 4:22 am
Posts: 10
Location: Moscow, Russia
works fine, thank's!


Top
 Profile  
 
 Post subject: nginx_active:-1 nginx_reading:-1 nginx_writing:-1 nginx_wait
PostPosted: Fri Apr 23, 2010 3:16 am 
Offline

Joined: Sun Dec 20, 2009 3:15 am
Posts: 39
Location: Kiev
nginx_active:-1 nginx_reading:-1 nginx_writing:-1 nginx_waiting:-1


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2010 1:13 am 
Offline

Joined: Tue Aug 17, 2010 10:50 pm
Posts: 11
Hmm.. what about status codes (404, 503 and etc...)
Is template exist or need to development?


Top
 Profile  
 
 Post subject: Re: scripts and templates for nginx
PostPosted: Thu May 03, 2012 9:34 pm 
Offline

Joined: Thu May 03, 2012 9:33 pm
Posts: 1
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?


Top
 Profile  
 
 Post subject: Re: scripts and templates for nginx
PostPosted: Mon May 07, 2012 12:19 pm 
Offline

Joined: Tue Jun 24, 2008 9:57 am
Posts: 13
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


Top
 Profile  
 
 Post subject: Re: scripts and templates for nginx
PostPosted: Tue Oct 23, 2012 2:19 am 
Offline

Joined: Tue Oct 23, 2012 2:12 am
Posts: 2
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/


Top
 Profile  
 
 Post subject: Re: scripts and templates for nginx
PostPosted: Tue Jul 09, 2013 10:35 am 
Offline

Joined: Tue Jul 09, 2013 10:34 am
Posts: 6
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group