{"id":33,"date":"2010-02-01T14:48:09","date_gmt":"2010-02-01T13:48:09","guid":{"rendered":"http:\/\/toderu.ro\/blog\/?p=33"},"modified":"2010-02-01T14:48:09","modified_gmt":"2010-02-01T13:48:09","slug":"manage-andor-monitor-logs-from-many-different-servers","status":"publish","type":"post","link":"https:\/\/kb.toderu.ro\/?p=33","title":{"rendered":"manage and\/or monitor logs from many different servers"},"content":{"rendered":"<p>\t\t\t\tProblem<\/p>\n<p>In some environments, administrators may find it difficult or tedious to manage and\/or monitor logs from many different<br \/>\nservers, and require a mechanism for directing logs from all systems to one central location.  Also, in some situations<br \/>\nwhen there is an issue with the \/ or \/var filesystem, redirecting logs to another server can allow important messages<br \/>\ncritical to troubleshooting to be printed, whereas they would have been lost if syslog was directing them to the local<br \/>\nfilesystem.<\/p>\n<p>Solution<\/p>\n<p>The syslogd daemon can be configured to send messages for all logging levels or individual levels to one or more syslog<br \/>\nservers.  In order to accomplish this, the file \/etc\/sysconfig\/syslog must be edited on the syslog server to allow<br \/>\nremote machines to send logs here.  Add the -r option to the SYSLOGD_OPTIONS like so:<\/p>\n<p><code>SYSLOGD_OPTIONS=\"-r -m 0\"<\/code><\/p>\n<p>After the file has been saved, the syslogd service needs to be restarted:<\/p>\n<p><code># service syslog restart<\/code><\/p>\n<p>To configure a client to send all messages to the remote server, append the following to \/etc\/syslog.conf:<\/p>\n<p><code>*.*         @hostname<\/code><\/p>\n<p>Replace hostname above with the IP address or the hostname of the centralized log server.  Or to only send individual<br \/>\nlogging levels to the remote server:<\/p>\n<p><code>*.info;mail.none;authpriv.none;cron.none      @hostname<\/code><\/p>\n<p>Again replacing hostname with the IP address or hostname of the remote server.  Now restart the syslog service on the<br \/>\nclient:<\/p>\n<p><code># service syslog restart<\/code><\/p>\n<p>The new configuration can be tested by restarting a service such as cups on the client:<\/p>\n<p><code># service cups restart<\/code><\/p>\n<p>Or by using a command such as:<\/p>\n<p><code># logger \"***** THIS IS A TEST *****\"<\/code><\/p>\n<p>The log messages related to the cups service being restarted or from the logger command should be found in<br \/>\n\/var\/log\/messages of the central server.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem In some environments, administrators may find it difficult or tedious to manage and\/or monitor logs from many different servers, and require a mechanism for directing logs from all systems to one central location. Also, in some situations when there is an issue with the \/ or \/var filesystem, redirecting logs to another server can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,12],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-linux","category-security"],"_links":{"self":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":0,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.toderu.ro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}