Restart a check_mk site with:
# su - fivedlab $ omd stop <output> $ omd start
Repeat with every other site. Another command to remember:
# su - fivedlab $ cmk -R
That restarts the core and everything else.
Restart a check_mk site with:
# su - fivedlab $ omd stop <output> $ omd start
Repeat with every other site. Another command to remember:
# su - fivedlab $ cmk -R
That restarts the core and everything else.
Since my Lenovo Yoga tablet (10″, dunno the model number any more) has a tendency to turn itself into a expensive paper weight after updates, here’s the procedure to unbrick it:
Don’t share, but enjoy!
# for i in a b; \ do echo $i ; smartctl -i /dev/sd$i | grep -i serial ;\ done
The disk not returning a serial is most likely the defective one.
Log in to the Hetzner Robot and create a Ticket: Left menu:
Anfragen -> Serverprobleme ausklappen -> Festplatte defekt
If the serial of the defective drive can’t be obtained, enter the serial of the working one and stress that the said serial is the working drive. Otherwise they’ll swap the wrong one and you end up with nothing!
Once the drive is replaced, copy the partition table from the working drive to the new one. sgdisk comes to rescue (THINK BEFORE YOU COPY & PASTE, WON’T WORK ANYWAY):
# sgdisk -R=/dev/sd[new] /dev/sd[old]
In doubt, RTFM twice: man sgdisk
mdadm comes to rescue:
# mdadm --manage /dev/md0 --add /dev/sd[new][part]
If you can’t get the former command to work, again: RTFM! It’s your data!
# watch cat /proc/mdstat
When plasmashell crashes, restart it like this without logging out:
$ kquitapp plasmashell ; sleep 3 ; plasmashell --shut-up &
If that doesn’t work, kill the process plasmashell with SIGKILL.
If KWin doesn’t work any more, restart it with:
$ kwin_x11 --replace 2>&1 > /dev/null &
Ein paar Bilder von der Schlammschlacht Wacken 2015:
Alle Fotos: Gallerie
This is kinda convoluted and not very intuitive.
Install xinetd first. The check_mk_agent package drops a configuration snippet into /etc/xinetd.d/, which makes xinetd listen on port 6556 for the agent.
The server-side check can be written in any language, as long as it can print to STDOUT. The output format is quite simple:
<<<check_name>>> data1 data2 ... dataN data1 data2 ... dataN ...
check_name is the identifier. It can be anything, but it has to be enclosed in <<<>>>. Data[1-] are the things you want to check, including performance counters, anything you like. Server-side the data will be split at white-spaces.
Simple example: check if bacula-director and bacula-storage-daemon is running (in perl):
#!/usr/bin/perl -w
use strict;
my @instances = `ps o cmd ax`;
my %count;
foreach my $i (@instances){
if($i =~ m#bacula-sd#){
$count{"storage_daemon"}++;
}
if($i =~ m#bacula-dir#){
$count{"director"}++;
}
}
print "<<<bacula_system>>>\n";
foreach my $k (keys %count){
print "$k $count{$k}\n";
}
Output:
<<<bacula_system>>> storage_daemon 1 director 1
One storage daemon process and one director process running. Perfect! Drop this script in /usr/lib/check_mk/plugins and make it executable.
Now we have to create the server-side counterpart. This has to be in python, because check_mk uses introspection extensively. Create a script named exactly as the identifier in local/share/check_mk/checks starting in the home directory of your check_mk-site-user. In the example given: local/share/check_mk/checks/bacula_system
The first thing we need is the dictionary check_info[] with at least these entries:
Example:
#!/usr/bin/python
def inventory_bacula_instances(info):
inventory = []
inventory.append( ("storage_daemon", None) )
inventory.append( ("director", None) )
return inventory
def check_bacula_instances(item, params, info):
count = 0
for each in info:
if each[0] == item:
count = int(each[1])
retval = 3
perfdata = [ (item, count) ]
if count == 0:
retstring = "No instance found for %s" % item
return (2, retstring, perfdata)
else:
retstring = "%d instances found for %s" % (int(count), item)
return (0, retstring, perfdata)
return (3, "Checking %s failed" % item, perfdata)
check_info["bacula_system"] = {
"check_function": check_bacula_instances,
"inventory_function": inventory_bacula_instances,
"service_description": 'Bacula: %s',
"has_perfdata": True,
}
The inventory function returns an array of Tuples with the items to check, in our case the items storage_daemon and directory returned by our perl script. The Tuples are fed to the check_function, in our case check_bacula_instances(item, params, info).
The check_function does the actual work. The return values are:
The parameters:
{'director': ['director', 1], 'storage_daemon': ['storage_daemon', 1]}
So info[‘director’][1] gives you the count of director processes.
Sprinkle the python script with “print <somethingorother>” and call
$ cmk <hostname>
from the command line.
Ich habe fertig 🙂
ffmpeg -i <infile> \ -an -sn \ -preset slow \ -tune film \ -s hd720 \ -c:v libx264 -threads 0 \ -x264opts fast_pskip=0 \ -b:v 4300k \ -minrate 4000k \ -maxrate 4400k \ <outfile.mkv>
Minimum bitrate 4000kb/s, maximum 4400kb/s, average 4300kb/s.
ffmpeg -i <infile> \ -vn -sn \ -acodec ac3 \ <outfile.ac3>
mkvextract tracks <infile> <trno>:<outfile>
Convert it to SRT with Subtitle Edit
mkvmerge <outfile_from_1> <outfile_from_2> <outfile_from_3> \ -o <final_out.mkv>
That’s it!
On May 27, 2015, I replaced the system raid of hadante (4 spinning 500 GB disks, RAID5) with 4 Samsung SSD drives (also 500 GB, RAID5). It was well worth it. The speed is amazing!
Along with the disks I ordered 4 3.5″ -> 2.5″ installation frames. As it turned out I only needed two, because you can easily stack two SSD drives on one frame with the right frame. There even is a gap in between, so I don’t expect heat problems.
The RAID5-rebuild was blazing fast. Overall, everything seems to be much snappier.
The serial numbers – SSD drives from top to bottom:
The old serial numbers – spinning drives from top to bottom: