Unknown graph at /usr/local/etc/munin/plugins/mysql_ line 1042

baas
На сайте с 17.09.2012
Offline
122
487

Добрый вечер.

Подскажите пожалуйста как решить эту проблему.

Та же проблема.

Система FreeBSD12

mysql 5.6

munin-common-2.0.49

munin-node-2.0.49_2

Остальные графики нормально рисуются.

Ошибка

munin-run mysql_
Unknown graph at /usr/local/etc/munin/plugins/mysql_ line 1042.

root@BASE:/usr/local/etc/munin/plugins # munin-run -d mysql_
# Processing plugin configuration from /usr/local/etc/munin/plugin-conf.d/plugins.conf
# Setting /rgid/ruid/ to /842/0/
# Setting /egid/euid/ to /842 842/0/
# Setting up environment
# Environment mysqladmin = /usr/local/bin/mysqladmin
# Environment PATH = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Environment mysqlopts = -u munin -pмой пароль
# Environment mysqlpassword = мой пароль
# Environment mysqluser = munin
# Environment mysqlconnection = DBI:mysql:mysql;host=localhost;port=3306
# Environment mysqlshow = /usr/local/bin/mysqlshow
# About to run '/usr/local/etc/munin/plugins/mysql_'
Unknown graph at /usr/local/etc/munin/plugins/mysql_ line 1042.
root@BASE:/usr/local/etc/munin/plugins #

Лог мунина.

2019/10/19-18:02:11 [12527] Error output from mysql_:
2019/10/19-18:02:11 [12527] Unknown graph at /usr/local/etc/munin/plugins/mysql_ line 1010.
2019/10/19-18:02:11 [12527] Service 'mysql_' exited with status 255/0.
2019/10/19-18:02:12 [12527] Error output from mysql_:
2019/10/19-18:02:12 [12527] Unknown graph at /usr/local/etc/munin/plugins/mysql_ line 1042.
2019/10/19-18:02:12 [12527] Service 'mysql_' exited with status 255/0.

Кусок кода /usr/local/etc/munin/plugins/mysql_

Жирным я выделил строку 1010 и 1042

sub config {
my $graph_name = shift;

# In MySQL 5.1 (and probably erlier versions as well) status
# variables are unique when looking at the last 19 characters.
#
# SELECT RIGHT(variable_name, 19), COUNT(*)
# FROM information_schema.global_status
# GROUP BY RIGHT(variable_name, 19)
# HAVING COUNT(*) > 1;
#
# Empty set (0.06 sec)
#
# There is one duplicate when looking at server variables
#
# SELECT RIGHT(variable_name, 19), COUNT(*)
# FROM information_schema.global_variables
# GROUP BY RIGHT(variable_name, 19)
# HAVING COUNT(*) > 1;
#
# +--------------------------+----------+
# | RIGHT(variable_name, 19) | COUNT(*) |
# +--------------------------+----------+
# | OW_PRIORITY_UPDATES | 2 |
# +--------------------------+----------+
# 1 row in set (0.05 sec)
#
# show global variables like '%OW_PRIORITY_UPDATES';
#
# +--------------------------+-------+
# | Variable_name | Value |
# +--------------------------+-------+
# | low_priority_updates | OFF |
# | sql_low_priority_updates | OFF |
# +--------------------------+-------+
# 2 rows in set (0.00 sec)
#
# Not a problem since we don't graph these

update_data();

die 'Unknown graph ' . ($graph_name ? $graph_name : '')
unless $graphs{$graph_name}; строка 1010

my $graph = $graphs{$graph_name};

my %conf = (%{$defaults{global_attrs}}, %{$graph->{config}{global_attrs}});
while (my ($k, $v) = each %conf) {
print "graph_$k $v\n";
}
print "graph_category mysql2\n";

for my $ds (@{$graph->{data_sources}}) {
my %ds_spec = (
%{$defaults{data_source_attrs}},
%{$graph->{config}{data_source_attrs}},
%$ds,
);
while (my ($k, $v) = each %ds_spec) {
# 'name' is only used internally in this script, not understood by munin.
printf("%s.%s %s\n", clean_fieldname($ds->{name}), $k, $v) unless ($k eq 'name');
}
print_thresholds(clean_fieldname($ds->{name}));
}

return 0;
}

sub show {
my $graph_name = shift;

update_data();

die 'Unknown graph ' . ($graph_name ? $graph_name : '')
unless $graphs{$graph_name}; Строка 1042

my $graph = $graphs{$graph_name};

die "Can't show data for '$graph_name' because InnoDB is disabled."
if $graph_name =~ /innodb_/ && $data->{_innodb_disabled};

for my $ds (@{$graph->{data_sources}}) {
my $value = exists $ds->{value}
? $ds->{value}($data)
: $data->{$ds->{name}};

printf "%s.value %s\n", clean_fieldname($ds->{name}), defined($value) ? $value : 'U';
}

return 0;
}
root@BASE:/usr/local/etc/munin/plugins # ls -al | awk '{print $9,$10,$11}'
cpu -> /usr/local/share/munin/plugins/cpu
if_igb0 -> /usr/local/share/munin/plugins/if_igb0
if_igb1 -> /usr/local/share/munin/plugins/if_igb1
iostat -> /usr/local/share/munin/plugins/iostat
memory -> /usr/local/share/munin/plugins/memory
mysql_ -> /usr/local/share/munin/plugins/mysql_
mysql_bytes -> /usr/local/share/munin/plugins/mysql_bytes
mysql_connections -> /usr/local/share/munin/plugins/mysql_connections
mysql_connections_per_user -> /usr/local/share/munin/plugins/mysql_connections_per_user
mysql_keys -> /usr/local/share/munin/plugins/mysql_keys
mysql_qcache -> /usr/local/share/munin/plugins/mysql_qcache
mysql_qcache_hits -> /usr/local/share/munin/plugins/mysql_qcache_hits
mysql_qcache_mem -> /usr/local/share/munin/plugins/mysql_qcache_mem
mysql_threads -> /usr/local/share/munin/plugins/mysql_threads
vmstat -> /usr/local/share/munin/plugins/vmstat
Настройка BSD систем. (https://www.fryaha.ru) Знание сила, незнание Рабочая сила!
VO
На сайте с 27.07.2008
Offline
127
#1

/usr/local/share/munin/plugins/mysql_ suggest

Дальше по вкусу

ln -s /usr/local/share/munin/plugins/mysql_ /usr/local/etc/munin/plugins/mysql_connections

ln -s /usr/local/share/munin/plugins/mysql_ /usr/local/etc/munin/plugins/mysql_commands

и т.д.

Посмотрите начало скрипта /usr/local/share/munin/plugins/mysql_ и будет все понятно.

Без указания что именно вы хотите рисовать он работать не будет.

baas
На сайте с 17.09.2012
Offline
122
#2
V(o)ViK:
/usr/local/share/munin/plugins/mysql_ suggest

Дальше по вкусу
ln -s /usr/local/share/munin/plugins/mysql_ /usr/local/etc/munin/plugins/mysql_connections
ln -s /usr/local/share/munin/plugins/mysql_ /usr/local/etc/munin/plugins/mysql_commands

и т.д.

Посмотрите начало скрипта /usr/local/share/munin/plugins/mysql_ и будет все понятно.
Без указания что именно вы хотите рисовать он работать не будет.

Хочу посмотреть какие доступны варианты.

# /usr/local/share/munin/plugins/mysql_ suggest
Failed to create share at /usr/local/lib/perl5/site_perl/Cache/SharedMemoryBackend.pm line 85.

pkg version | grep "p5-Ca"
p5-Cache-2.11 =
p5-Cache-Cache-1.08 =

perl -v

This is perl 5, version 30, subversion 0 (v5.30.0) built for amd64-freebsd-thread-multi

кусок кода

/usr/local/lib/perl5/site_perl/Cache/SharedMemoryBackend.pm

Строку 85 выделил жирным.

# create a IPC::ShareLite share under the ipc_identifier

sub _Instantiate_Share
{
my ( $p_ipc_identifier ) = Static_Params( @_ );

Assert_Defined( $p_ipc_identifier );

my %ipc_options = (
-key => $p_ipc_identifier,
-create => 'yes',
-destroy => 'no',
-exclusive => 'no'
);

my $share = new IPC::ShareLite( %ipc_options ) or строка 85
throw Error::Simple( "Couldn't instantiate IPC::ShareLite: $!" );

return $share;
}
VO
На сайте с 27.07.2008
Offline
127
#3

/usr/local/share/munin/plugins/mysql_ suggest

bin_relay_log
binlog_groupcommit
commands
connections
files_tables
innodb_bpool
innodb_bpool_act
innodb_insert_buf
innodb_io
innodb_io_pend
innodb_log
innodb_rows
innodb_semaphores
innodb_tnx
myisam_indexes
network_traffic
qcache
qcache_mem
replication
select_types
slow
sorts
table_locks
tmp_tables

Уберите все что у вас написано в [mysql_*] в plugins.conf и запустите команду еще раз.

Проверьте, что установлен p5-DBD-mysql

baas
На сайте с 17.09.2012
Offline
122
#4

Подниму тему.

Запустил новый сервер.

В чем может быть проблема не пойму.

Софт одинаковый, конфиг в мунине mysql одинаков.

FreeBSD 12

munin-common-2.0.64                =
munin-node-2.0.64                  =
p5-Cache-2.11                      =
p5-Cache-Cache-1.08                =
p5-DBD-mysql-4.050                 =
perl5-5.32.0                       =

Конфиг plugins.conf

[mysql_*]
env.mysqlconnection DBI:mysql:mysql;host=localhost;port=3306
env.mysqluser munin
env.mysqlopts -u munin -pмой_пароль
env.mysqlpassword мой_пароль
env.mysqladmin /usr/local/bin/mysqladmin
env.mysqlshow /usr/local/bin/mysqlshow

Ошибка такая что и была на старом сервере.

# /usr/local/share/munin/plugins/mysql_ suggest
Failed to create share at /usr/local/lib/perl5/site_perl/Cache/SharedMemoryBackend.pm line 85.

Старый сервер FreeBSD 12

Конфиг plugins.conf

[mysql*]
env.mysqlconnection DBI:mysql:mysql;host=localhost;port=3306
env.mysqluser munin
env.mysqlopts -u munin -pмой_пароль
env.mysqlpassword мой_пароль
env.mysqladmin /usr/local/bin/mysqladmin
env.mysqlshow /usr/local/bin/mysqlshow
munin-common-2.0.64                =
munin-node-2.0.64                  =
p5-Cache-2.11                      =
p5-Cache-Cache-1.08                =
p5-DBD-mysql-4.050                 =
perl5-5.32.0                       =
# /usr/local/share/munin/plugins/mysql_ suggest
bin_relay_log
binlog_groupcommit
commands
connections
files_tables
innodb_bpool
innodb_bpool_act
innodb_insert_buf
innodb_io
innodb_io_pend
innodb_log
innodb_rows
innodb_semaphores
innodb_tnx
myisam_indexes
network_traffic
qcache
qcache_mem
replication
select_types
slow
sorts
table_locks
tmp_tables



baas
На сайте с 17.09.2012
Offline
122
#5

Пока нашел решение заменить Cache::SharedMemoryCache на Cache::FileCache.

В самом начале файла заменяем две строчки. 

/usr/local/share/munin/plugins/mysql_

меняем

BEGIN {
    eval { require Cache::SharedMemoryCache; };

На

BEGIN {
        eval 'require Cache::FileCache';

меняем

my $shared_memory_cache ;
if ($has_cache)
{
  $shared_memory_cache = Cache::SharedMemoryCache->new(\%cache_options)

На

my $shared_memory_cache ;
if ($has_cache)
{
        $shared_memory_cache = Cache::FileCache->new(\%cache_options)

То что нужно заменить выделил жирным.

Почему с Cache::SharedMemoryCach не работает, хз.

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий