plugins google analytics

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

plugins google analytics

Post by brandon »

I have a question about the plugins : Google Analytics Realtime
Where I have Install the required python modules on developer machine? Can help me?
I used this tutorial:
https://github.com/pfy/ga_realtime_nagios
What that's pip?

someone install this plugin?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post by rkennedy »

PIP is similar to YUM for python.

To install it, you'll need to run yum install python-pip -y

Once that's done, you should be able to follow the instructions.
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post by brandon »

OK, but where can I find python auth.py ?

This should generate a file called: analytics.dat

but I can not find anywhere analitycs.dat
someone install this plugin?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post by rkennedy »

The auth.py file is right on the GitHub page you linked - https://github.com/pfy/ga_realtime_nagi ... er/auth.py
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post by brandon »

how to convert a plugin that alerts warning and criticals showed under the limit?
If I set -w 10 -c 5 to send alerts
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

Re: plugins google analytics

Post by nozlaf »

brandon wrote:how to convert a plugin that alerts warning and criticals showed under the limit?
If I set -w 10 -c 5 to send alerts
not exactly sure what you are trying to achieve perhaps give a little more detail is the check resulting in say 7 but you want that to show warning when its reporting critical because 7 is above the critical threshold which you set? if so perhaps the negate plugin will achieve what you want https://assets.nagios.com/downloads/nag ... Plugin.pdf
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post by rkennedy »

brandon wrote:how to convert a plugin that alerts warning and criticals showed under the limit?
If I set -w 10 -c 5 to send alerts
Can you please show us an example?
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post by brandon »

OK
Now plugin displays an alert if too many people online, example:

Code: Select all

define service{
    use                             service
    host_name                       localhost
    service_description             google analitycs
    check_command                   ga_realtime!MY_ID!80!90!
and display:

Code: Select all

REALTIMEVISITORS WARNING - activeVisitors is 85 (outside range 0:80) 
and I want the opposite, so warning if less than 80 people online

if more than 80 people online, then the alert is OK
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: plugins google analytics

Post by jolson »

Could you please show us the command definition for ga_realtime? If you show us that file it will help us continue the troubleshooting process. I believe that the resolution will be changing some arguments around - this is a great reference guide for warning/critical syntax: https://nagios-plugins.org/doc/guidelin ... HOLDFORMAT
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post by brandon »

The command definition for ga_realtime:

Code: Select all

define command{
    command_name    ga_realtime
    command_line    $USER1$/ga_realtime.py -D /etc/nagios3/google_auth_data  -V $ARG1$ -w $ARG2$ -c $ARG3$
}
I want alerts as for check_disk or as space is limited, so warning if less than 80 people online
Locked