remote snippets

Mounting a remote network drive with SSHFS on OSX

Tagged sshfs, mount, remote, drive, osx  Languages bash
  1. Install SSHFS

http://code.google.com/p/macfuse/

  1. Read documentation

http://code.google.com/p/macfuse/wiki/MACFUSE\_FS\_SSHFS

  1. Create symlink
ln -s /Applications/sshfs.app/Contents/Resources/sshfs-static /usr/local/bin/sshfs
  1. Mount drive
mkdir /Volumes/mount_name
sshfs -p 666 server:/ /Volumes/mount_name -oreconnect,ping_diskarb,volname=mount_name
  1. References

http://lifehacker.com/software/ssh/geek-to-live--mount-a-file-system-on-your-mac-over-ssh-246129.php

Log shipping with rsyslog

Tagged logging, logs, remote, rsyslog, shipping  Languages 

Server

/etc/rsyslog.conf

$ModLoad imtcp
 
#
# Disable rate-limiting
#
# "interval = 1 AND burst = 1000" means rsyslog starts dropping messages if more than 1000 messages are received within 1 seconds. 
$SystemLogRateLimitInterval 0
$SystemLogRateLimitBurst 0

/etc/rsyslog.d/35-remote-logs.conf

input(type="imtcp" port="514" ruleset="remote")
template(name="PerRemoteHostLogFileName" type="list") {
   constant(value="/var/log/hosts/")
   property(name="$year")
   constant(value="/")
   property(name="$month")
   constant(value="/")
   property(name="hostname" securepath="replace")
   constant(value="/")
   property(name="programname" securepath="replace")
   constant(value=".log")
}
ruleset(name="remote") {
   $FileCreateMode 0640
   $DirCreateMode 0755
   ?PerRemoteHostLogFileName
}

Client

/etc/rsyslog.conf

# Disable rate-limiting
$SystemLogRateLimitInterval 0
$SystemLogRateLimitBurst 0

#
# Send all logs to centralized log server over TCP
#
*.*       @@{{log_server_ip_addr}}