Page 2 of 3

Re: plugins google analytics

Posted: Fri Feb 26, 2016 11:40 am
by hsmith
Have you looked into using the negate plugin that nozlaf mentioned earlier? https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: plugins google analytics

Posted: Mon Feb 29, 2016 2:58 am
by brandon
something does not work
I have:

Code: Select all

define command {
       command_name negate_check
       command_line $USER1$/negate $USER1$/ga_realtime.py -D /etc/nagios3/google_auth_data  -V $ARG1$ -w $ARG2$ -c $ARG3$
}

Code: Select all

define service{
    use                             service
    host_name                       localhost
    service_description             google analitycs
    check_command                   negate_check!MY_ID!80!90!
and I get

Code: Select all

[b][null)[/b]

Re: plugins google analytics

Posted: Mon Feb 29, 2016 10:54 am
by rkennedy
What is the result if you run it over the CLI?

Also, what are the permissions on ga_realtime.py?

Code: Select all

ls -l ga_realtime.py

Re: plugins google analytics

Posted: Tue Mar 01, 2016 2:38 am
by brandon
What?
My plugins working properly, becasue this plugin displays of people online, but does not work with the function negate

When I try to run ./negate I get:
-bash: ./negate: you can not run a binary file
the permissions on negate is 777

Re: plugins google analytics

Posted: Tue Mar 01, 2016 10:21 am
by rkennedy
brandon wrote: and I get

Code: Select all

[b][null)[/b]
I was under the impression that's what you were seeing. Please run ls -l ga_realtime.py and post the result.

Re: plugins google analytics

Posted: Wed Mar 02, 2016 3:09 am
by brandon
some do not understand, but ok:

Code: Select all

-rwxr-xr-x 1 root root 2419 02-23 08:58 ga_realtime.py

Re: plugins google analytics

Posted: Wed Mar 02, 2016 12:09 pm
by rkennedy
Please change the permissions on the ga_realtime.py file. chown nagios:nagios ga_realtime.py[/code] This could be why the negate plugin cannot read the file.

Re: plugins google analytics

Posted: Thu Mar 03, 2016 2:28 am
by brandon
If the permissions are of 777 then it does not matter who owns the file
but ok, I did:

Code: Select all

-rwxrwxrwx 1 nagios nagios 2419 02-23 08:58 ga_realtime.py
-rwxrwxrwx 1 nagios nagios 38152 2012-01-17  negate
end I get:

Code: Select all

(null)

Re: plugins google analytics

Posted: Thu Mar 03, 2016 12:49 pm
by rkennedy
What is the full input/ output if you run it without the negate check over the CLI? I don't think this plugin is parsing properly, which is causing the errors with the negate plugin.

I'll try to replicate this on my end once I have that information.

Re: plugins google analytics

Posted: Fri Mar 04, 2016 2:28 am
by brandon
I think that the topic is not moving forward, because I wrote it before:

Code: Select all

define service{
    use                             service
    host_name                       localhost
    service_description             google analitycs
    check_command                   ga_realtime!MY_ID!80!90!
check the CLI:

Code: Select all

./ga_realtime.py -D /etc/nagios3/google_auth_data -V  MY_ID -w 10 -c 15
Maybe someone knows how to change this plugin?