Menu
  • HOME
  • TAGS

run a script when a new veth interface is added

linux,ubuntu,networking,docker,sysadmin

You should write a custom udev rule that runs a script of yours each time a new interface is added. This is what Debian does for handling interface "hotplug". /etc/udev/rules.d/90-my-networking.rules: SUBSYSTEM=="net", RUN+="/usr/local/bin/my-networking-agent.sh" /usr/local/bin/my-networking-agent.sh: #!/bin/sh logger "hey I just got interface ${INTERFACE} with action ${ACTION}" EDIT Here is how you can...

Run Infinite Bash loop in background with Paramiko

python,bash,background,paramiko,sysadmin

Here is how I solved this problem (finally): s = paramiko.SSHClient() s.load_system_host_keys() s.connect(hostname, port, username, password) cmd = "echo 'while true; do date >> ~/file.txt; sleep 1; done &' >run.sh" (stdin, stdout, stderr) = s.exec_command(cmd) cmd = "bash run.sh </dev/null >>/dev/null 2>&1" (stdin, stdout, stderr) = s.exec_command(cmd) s.close() ...

Crontab and its logs

crontab,sysadmin

Usually the cron commands' output is sent to the owner via mail (man mail), but this when you execute a code that returns an output (stdout and stderr). When you login you should see something like "There are new mails". I don't know though if wrong cron schedules like yours...

Hiera, default site.pp and error could not find class

puppet,server,sysadmin,hiera

Your parameter keys are incorrect. For example, this ... zabbix::agent:zabbix_version : '2.2' ... should instead be ... zabbix::agent::zabbix_version: '2.2' . The main issue is one too few colons between zabbix::agent and zabbix_version. I don't think whitespace between the key and trailing colon matters, but it's more conventional to not have...

Puppet referring to a module inside a module

linux,puppet,sysadmin

Having a modules/ subtree in a module is no valid structure as far as the autoloader is concerned. There is no semantics for submodules. If you desperately want this particular case to work, you will have to add /etc/puppet/modules/A to your modulepath config setting. You may wish to ask a...

Unable to remove Volume Group due to Incorrect metadata area header checksum

sysadmin,raid,lvm

As long as you don't care what's on the drive at /dev/sdc, try this: dd if=/dev/zero of=/dev/sdc bs=1m count=10 That will zero out the first 10 MB of the disk, including any LVM or RAID headers. Then reboot; the system should see that the disk is no longer a part...

Puppet remove defined 'message' as ' in output

automation,output,puppet,server,sysadmin

For current versions of Puppet, the output of notify { "w00t": message => "foo" } looks like Notice: foo Notice: /Stage[main]/Main/Notify[w00t]/message: defined 'message' as 'foo' This is only slightly less verbose. There is not really a way to loose/suppress the second message. It has been discussed briefly, albeit with no...

scan computer for a file and output folder location

vbscript,server,sysadmin

OK, you could use a regex to match the name. Define it up front, in your global scope: Dim re Set re = New RegExp re.IgnoreCase = True re.Pattern = "^arc\w{3}of$" I'm using \w, which is equivalent to [a-zA-Z_0-9]. You can change this if you're expecting only digits (\d) or...