ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

I'm using ss_get_by_ssh to get a few nginx stats:
  • Percona Nginx Accepts/Handled GT
    Percona Nginx Requests GT
    Percona Nginx Scoreboard GT
For recently added hosts graphs are empty and in cacti.log I'm seeing the following:

Code: Select all

SPINE: Poller[1] Device[496] TH[1] DS[14760] SCRIPT: /usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_get_by_ssh.php --host 'host10' --type nginx --items hw,ig,ih,ii --server '' --url '/nginx_status' --http-user '' --http-password , output: hw:-1 ig:-1 ih:-1 ii:-1
SPINE: Poller[1] Device[594] TH[1] DS[15453] SCRIPT: /usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_get_by_ssh.php --host 'host11' --type nginx --items hw,ig,ih,ii --server '' --url '/nginx_status' --http-user '' --http-password , output: hw:-1 ig:-1 ih:-1 ii:-1
For the older ones that are working properly and drawing logs I'm seeing this in cacti.log:

Code: Select all

SPINE: Poller[1] Device[242] TH[1] DS[5483] SCRIPT: /usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_get_by_ssh.php --host host06 --type nginx --items hx,hy --server  --url /nginx_status --http-user  --http-password , output: hx:2889178 hy:2889178
SPINE: Poller[1] Device[241] TH[1] DS[5481] SCRIPT: /usr/local/bin/php -q /usr/local/share/cacti/scripts/ss_get_by_ssh.php --host host01 --type nginx --items hz --server  --url /nginx_status --http-user  --http-password , output: hz:258097768
I tried running the script manually, that returns proper values:

Code: Select all

su -m cacti -c 'php ss_get_by_ssh.php --host host10 --type nginx --items hx,hy --server  --url /nginx_status --http-user  --http-password'
hx:2544144 hy:2544144
I noticed that --items list is different as well the not working one has some extra apostrophes ('): --host '', --server '', etc; however in Cacti's web they look the very same
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

I enabled debug mode in ss_get_by_ssh.php and found some discrepancies, see array elements 8 & 12 :o

Code: Select all

array (
  0 => '/usr/local/share/cacti/scripts/ss_get_by_ssh.php',
  1 => '--host',
  2 => 'host01',
  3 => '--type',
  4 => 'nginx',
  5 => '--items',
  6 => 'hx,hy',
  7 => '--server',
  8 => '--url',
  9 => '/nginx_status',
  10 => '--http-user',
  11 => '--http-password',
)
array (
  'host' => 'host01',
  'type' => 'nginx',
  'items' => 'hx,hy',
  'server' => NULL,
  'url' => '/nginx_status',
  'http-user' => NULL,
  'http-password' => NULL,
)


array (
  0 => '/usr/local/share/cacti/scripts/ss_get_by_ssh.php',
  1 => '--host',
  2 => 'host10',
  3 => '--type',
  4 => 'nginx',
  5 => '--items',
  6 => 'hx,hy',
  7 => '--server',
  8 => '',
  9 => '--url',
  10 => '/nginx_status',
  11 => '--http-user',
  12 => '',
  13 => '--http-password',
)
array (
  'host' => 'host10',
  'type' => 'nginx',
  'items' => 'hx,hy',
  'server' => '',
  'url' => '/nginx_status',
  'http-user' => '',
  'http-password' => NULL,
)
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by netniV »

OK, so this would appear to be the use of a flag which is getting a value associated to it. Can you post the input string being used on the Data Input Method?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

netniV, are you asking for what can be found on the attached screen shot?
Attachments
ss_get_by_ssh-data_source.png
ss_get_by_ssh-data_source.png (352.12 KiB) Viewed 1561 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by netniV »

No, the data input method.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

The data input method is the php from here: https://github.com/percona/percona-moni ... by_ssh.php
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by netniV »

I mean within your cacti setup. Not the source file.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

I thought the data input method is the script source used to gather data for this data source, as it also appears on the screen shot on the second paragraph. I'm sorry I have a hard time finding the information.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by netniV »

Apologies, I took the time to read this further. It turns out that my earlier comment was made without reading the debug stuff properly. And now that I've read the script, can you email me the full debug log to netniv@cacti.net? I think I know what may be occurring, but I need to verify this.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

netniV, I'm working on it
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

I just sent the email

I'm seeing some weird things like:

Code: Select all

  0 => 'result of /usr/local/bin/wget   -U Cacti/1.0 -q -O - -T 5 "http://host03:80/nginx_status?auto"',
vs.

Code: Select all

  0 => 'result of /usr/local/bin/wget   -U Cacti/1.0 -q -O - -T 5 "http://:80/nginx_status?auto?auto"',
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

After taking another look at the ARRAY and the extra , and ' I think there is the issue, but I don't know how to fix it yet
Sparkee
Posts: 11
Joined: Mon Oct 15, 2018 10:44 am

Re: ss_get_by_ssh - output: hw:-1 ig:-1 ih:-1 ii:-1

Post by Sparkee »

For those interested netniV fixed this issue here https://github.com/percona/percona-moni ... ea6d7b8b33
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests