Syslog 2.1 - Doesn't show any register

General discussion about Plugins for Cacti

Moderators: Moderators, Developers

Post Reply
Author
Message
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Syslog 2.1 - Doesn't show any register

#1 Post by rsanchezre » Thu May 18, 2017 7:11 am

Hi,
I'm running cacti 1.1.6 and syslog plugin 2.1. When i try to see some syslog register (Syslog tab - System logs), it doesn't show me any of them.

I made the following,

- I've check that the syslog plugin was installed correctly.
- I've set up the config.php correcty.
- I've checked that syslog messages are comming from devices and they are inserted into syslog_incomming table of MySQL.
- I've checked that syslog_host table is filling up.
- I've not have error messages in cacti logs.

So, I'd apprecite if you could tell me what can i see to resolve my issue
Regards.
Rodrigo
Last edited by rsanchezre on Fri May 19, 2017 9:44 am, edited 1 time in total.

rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

#2 Post by rsanchezre » Fri May 19, 2017 9:43 am

As additional information, i added alert roules and when i go to Alert Logs tab, registers are shown me correctly
Alert Logs.PNG
Alert Logs.PNG (32.38 KiB) Viewed 1634 times
but as I said, when i go to system logs tab (same period), does not shown any thing and should show something
system logs.png
system logs.png (22.66 KiB) Viewed 1634 times
Well, I'd appreciate some help
Regards

rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

#3 Post by rsanchezre » Wed Jun 07, 2017 9:58 am

Could some one healp me??
Regards

itkroplis
Posts: 17
Joined: Sun Jun 04, 2017 6:25 am

Re: Syslog 2.1 - Doesn't show any register

#4 Post by itkroplis » Mon Jun 19, 2017 12:09 pm

Show syslog-ng conf, syslog config.php

rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

#5 Post by rsanchezre » Mon Jun 19, 2017 1:31 pm

Hi Itkroplis,

Thanks for answer....
Here you have both configurations

this is sylog-ng config file

source s_all {
udp(ip("0.0.0.0") port(514));
};

destination d_mysql {
sql(
type(mysql)
host("localhost") username("cactiuser") password("XXXXXXXX")
database("syslog")
table("syslog_incoming")
columns("facility_id","priority_id","programn","date","time","host","message")
values("$FACILITY_NUM","$LEVEL_NUM","$PROGRAM","$YEAR-$MONTH-$DAY","$HOUR:$MIN:$SEC","$HOST_FROM","$MSG")
);
};

destination remotos { file("/var/log/BST-$YEAR$MONTH$R_syslog.log"); };

log {
source(s_all);
destination(d_mysql);
destination(remotos);
};




and this is config.php (/usr/share/cacti/site/plugins/syslog)

*/

global $config, $database_type, $database_default, $database_hostname;
global $database_username, $database_password, $database_port;

/* revert if you dont use the Cacti database */
$use_cacti_db = false;

if (!$use_cacti_db) {
$syslogdb_type = 'mysql';
$syslogdb_default = 'syslog';
$syslogdb_hostname = 'localhost';
$syslogdb_username = 'cactiuser';
$syslogdb_password = 'XXXXXXXX';
$syslogdb_port = 3306;
}else{
$syslogdb_type = $database_type;
$syslogdb_default = $database_default;
$syslogdb_hostname = $database_hostname;
$syslogdb_username = $database_username;
$syslogdb_password = $database_password;
$syslogdb_port = $database_port;
}

/* field in the incomming table */
$syslog_incoming_config['dateField'] = 'date';
$syslog_incoming_config['timeField'] = 'time';
$syslog_incoming_config['priorityField'] = 'priority_id';
$syslog_incoming_config['facilityField'] = 'facility_id';
$syslog_incoming_config['hostField'] = 'host_id';
$syslog_incoming_config['textField'] = 'message';
$syslog_incoming_config['id'] = 'seq';

?>


Regards.

rcsmota
Posts: 6
Joined: Fri Sep 08, 2017 6:38 am

Re: Syslog 2.1 - Doesn't show any register

#6 Post by rcsmota » Fri Jan 12, 2018 8:53 am

Hi;

Your syslog_incomming table is on syslog data base or cacti data base?

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: Syslog 2.1 - Doesn't show any register

#7 Post by Pucho » Sun Jan 14, 2018 8:46 pm

rsanchezre wrote: destination d_mysql {
sql(
type(mysql)
host("localhost") username("cactiuser") password("XXXXXXXX")
database("syslog")
table("syslog_incoming")
columns("facility_id","priority_id","programn","date","time","host","message")
values("$FACILITY_NUM","$LEVEL_NUM","$PROGRAM","$YEAR-$MONTH-$DAY","$HOUR:$MIN:$SEC","$HOST_FROM","$MSG")
);
};

You've got a typo in there that might be causing your syslog-ng to fail the query to the database.

programn != program

Code: Select all

MariaDB [cacti]> describe syslog_incoming;
+-------------+---------------------+------+-----+---------+----------------+
| Field       | Type                | Null | Key | Default | Extra          |
+-------------+---------------------+------+-----+---------+----------------+
| facility_id | int(10) unsigned    | YES  |     | NULL    |                |
| priority_id | int(10) unsigned    | YES  |     | NULL    |                |
| program     | varchar(40)         | YES  | MUL | NULL    |                |
| date        | date                | YES  |     | NULL    |                |
| time        | time                | YES  |     | NULL    |                |
| host        | varchar(64)         | YES  |     | NULL    |                |
| message     | varchar(1024)       | NO   |     |         |                |
| seq         | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| status      | tinyint(4)          | NO   | MUL | 0       |                |
+-------------+---------------------+------+-----+---------+----------------+
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

#8 Post by rsanchezre » Thu Feb 01, 2018 11:15 am

Thanks Pucho for help me to find my mistake. I've fixed this parameter and now is working fine.
Thanks again.
Regards
Rodrigo

Post Reply