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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: plugins google analytics

Post by hsmith »

Have you looked into using the negate plugin that nozlaf mentioned earlier? https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Former Nagios Employee.
me.
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post 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]
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post 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
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post 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.
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post 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.
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post 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)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: plugins google analytics

Post 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.
Former Nagios Employee
brandon
Posts: 30
Joined: Wed Aug 19, 2015 4:10 am

Re: plugins google analytics

Post 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?
Locked