Page 1 of 3

plugins google analytics

Posted: Wed Feb 17, 2016 11:21 am
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?

Re: plugins google analytics

Posted: Wed Feb 17, 2016 2:59 pm
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.

Re: plugins google analytics

Posted: Thu Feb 18, 2016 4:25 am
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?

Re: plugins google analytics

Posted: Thu Feb 18, 2016 10:43 am
by rkennedy
The auth.py file is right on the GitHub page you linked - https://github.com/pfy/ga_realtime_nagi ... er/auth.py

Re: plugins google analytics

Posted: Tue Feb 23, 2016 3:07 am
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

Re: plugins google analytics

Posted: Tue Feb 23, 2016 5:08 am
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

Re: plugins google analytics

Posted: Tue Feb 23, 2016 10:41 am
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?

Re: plugins google analytics

Posted: Wed Feb 24, 2016 6:40 am
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

Re: plugins google analytics

Posted: Wed Feb 24, 2016 3:42 pm
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

Re: plugins google analytics

Posted: Fri Feb 26, 2016 6:58 am
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