smtc0097 / mysql-cacti-templates

Automatically exported from code.google.com/p/mysql-cacti-templates
GNU General Public License v2.0
0 stars 0 forks source link

MongoDB templates only work on the default port for localhost #182

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, the MongoDB templates only work on the default host and port, which 
are localhost and 27017, respectively.  --server and --port2 are easily 
supported with the following patch (so that one can SSH through to a server, 
then connect to a different host/port from there to get stats of a remote 
server that's twice removed and has a non-default port).

The attached patch adds this functionality very simply by passing the proper 
arguments on the "mongo" subcommand.

I've only tested this patch from the command line (and it's working great for 
me), but I think I got everything updated properly to make this modifiable from 
within Cacti as well.

Original issue reported on code.google.com by admwiggin on 15 Feb 2011 at 9:33

Attachments:

GoogleCodeExporter commented 8 years ago
I think I should also point out that the templates as they are claim to accept 
port2 for mongodb, but then completely ignore it. :)

Original comment by admwiggin on 15 Feb 2011 at 9:41

GoogleCodeExporter commented 8 years ago
After finally testing these out in Cacti, it seems as though either my 
configuration is wonky, Cacti is wonky, or I "did it wrong" in the patch, 
because I can't convince Cacti to switch the MongoDB port for a single graph 
(trying to use it for showing the Slave Lag of my MongoDB slave that runs on 
the same machine using a different hard drive and port 27018).  No matter what 
I change or reset, port2 is completely ignored.  Another set of eyes to make 
sure at least this patch is correct would be very much appreciated.

Original comment by admwiggin on 15 Feb 2011 at 10:39

GoogleCodeExporter commented 8 years ago
What version of the templates are you using?  There were --mpds bugs in 1.1.7 
that are fixed now.

Original comment by baron.schwartz on 15 Feb 2011 at 12:38

GoogleCodeExporter commented 8 years ago
This was against latest SVN.

Original comment by admwiggin on 15 Feb 2011 at 8:38

GoogleCodeExporter commented 8 years ago
For me, manually invoking the command works (see below), but there's a blank 
output line before the output string that Cacti wants. Is that a problem? My 
rrd files are getting U U U U instead of numbers. As far as Cacti running the 
script and ignoring the host, I don't know if that's true or how I would verify 
the command it's actually invoking. I guess I need a little refresher on 
troubleshooting Cacti, but overall it seems like this mongo script is almost, 
but not quite working (for me, at this time).

# php ss_get_by_ssh.php --host mongo1 --type mongodb --items  do,dp,dq,dr,ds,dt 

do:9898 dp:24007 dq:6416 dr:27 ds:82912 dt:89561

Original comment by gabriel9...@gmail.com on 23 Feb 2011 at 10:51

GoogleCodeExporter commented 8 years ago
Resolved my problem, similar to issue 164, 
http://code.google.com/p/mysql-cacti-templates/issues/detail?id=164

rrd files have data now, after deleting a stray blank line at the end of the 
config file, ss_get_by_ssh.php.cnf

However, the original poster here may have had another issue, not sure.

Original comment by gabriel9...@gmail.com on 23 Feb 2011 at 11:35

GoogleCodeExporter commented 8 years ago
Indeed.  I got the script with my host2 and port patch working perfectly 
manually (returning exactly what would be expected), but can't get Cacti to 
invoke the script with --host2 and/or --port.  It just ignores the parameters 
and invokes the script without them.

Original comment by admwiggin on 24 Feb 2011 at 1:01

GoogleCodeExporter commented 8 years ago
I am sure this is something simple, but I just haven't had time to look at it.  
I think that you can compare the definition file to one that we know works, 
such as apache_definitions.pl, and if something is missing or wrong it'll pop 
out at you.  It won't be in the graphs themselves -- it will be either in the 
data-gathering script, or the mongodb_definitions.pl file near the bottom, in 
the definition of data inputs.

Original comment by baron.schwartz on 24 Feb 2011 at 8:27

GoogleCodeExporter commented 8 years ago
I'm also sure it's something simple, hence the frustration.  I've checked my 
input lines against the memcached input lines, and can't see anything too 
obvious.

Original comment by admwiggin on 28 Feb 2011 at 4:53

GoogleCodeExporter commented 8 years ago
After re-reading the CreatingGraphs wiki page, I noticed input_string.  I 
didn't change input_string, which is probably why I'm borking here.  Will test 
later to make sure that's my only problem, and if it is, I'll post another 
patch. :)

Original comment by admwiggin on 13 Mar 2011 at 11:39

GoogleCodeExporter commented 8 years ago
Gonna do the +1 thing here, works fine for me after this was done and 
regenerating)

After reading 
http://code.google.com/p/mysql-cacti-templates/wiki/CustomizingTemplates and 
regenerating the script the thing worked fine.

Had to add --port2 <port2> and --server <server> to the input_string (as i just 
realized was noted in the last message)

patch attached.

Original comment by halkeye on 8 Apr 2011 at 8:08

Attachments: