The following one liner will look for inconsistent page groups in a Ceph page group dump and repair them. Nice quick way to fix-up inconsistencies!
ceph pg dump | grep -i incons | cut -f 1 | while read i; do ceph pg repair ${i} ; done
ceph pg dump | grep -i incons | cut -f 1 | while read i; do ceph pg repair ${i} ; done
The output from the script will look something like the output below:#!/bin/perl @luns = `/usr/sbin/luxadm probe | grep Logical | sed -e 's/.*\://g'|grep rdsk`; foreach $lun (@luns) { chomp($lun); $lun2 = $lun; $lun2 =~ s/\/dev\/rdsk\///g; print "Disk:$lun2\t"; @luxadm = `/usr/sbin/luxadm display $lun`; $pathcount = 0; foreach $luxadm (@luxadm) { chomp($luxadm); if ($luxadm =~ /State/) { $luxadm =~ s/State//g; $luxadm =~ s/^\s+//; print "Path$pathcount:$luxadm\t"; $pathcount++; } } print "\n"; }
#perl pathfinder.pl Disk:c6t60060E80054337000000433700000526d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000527d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000301d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000300d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000278d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000277d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE Disk:c6t60060E80054337000000433700000275d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
The output from the script will look similar to the following:#!/usr/bin/perl @sms = `ipcs -pm|grep "^m"|awk {'print \$2":"\$7":"\$8'}`; foreach $sms (@sms) { chomp($sms); ($shmem,$cpid,$lpid) = split(/:/,$sms); $cpids=` ps -ef|grep $cpid|grep -v grep >/dev/null 2>&1;echo \$?`; $lpids=` ps -ef|grep $lpid|grep -v grep >/dev/null 2>&1;echo \$?`; chomp($cpids,$lpids); if (($cpids eq "1") && ($lpids eq "1")) { $message = "Memory can be reclaimed"; #$memclean = `ipcrm -m $shmem`; } else { $message = "Memory active"; } print "$shmem - $cpid - $lpid - $cpids - $lpids - $message\n"; }
# perl mem_clean.pl 587203562 - 10885 - 17891 - 0 - 0 - Memory active 922746991 - 9728 - 10885 - 0 - 0 - Memory active 150995435 - 9728 - 10885 - 0 - 0 - Memory active 150995432 - 9728 - 17891 - 0 - 0 - Memory active 150995398 - 17421 - 17891 - 1 - 0 - Memory active 150995396 - 13421 - 13891 - 1 - 1 - Memory can be reclaimed 150995387 - 9728 - 10885 - 0 - 0 - Memory active 150995382 - 9728 - 10885 - 0 - 0 - Memory active 150995380 - 9728 - 10885 - 0 - 0 - Memory active 150995379 - 9728 - 10885 - 0 - 0 - Memory active 150995377 - 9728 - 17891 - 0 - 0 - Memory active 150995374 - 9728 - 17891 - 0 - 0 - Memory active 150995371 - 9727 - 10886 - 1 - 0 - Memory active 117440821 - 9728 - 10885 - 0 - 0 - Memory active 117440819 - 9728 - 10885 - 0 - 0 - Memory active
#!/usr/bin/perl $cmd=`rm -r -f /root/.spacecmd/spacewalk.schmaustech.com`; $yestdate=`TZ=CDT+24 /bin/date +%y-%m-%d`; #$yestdate=`TZ=CDT /bin/date +%Y-%m-%d`; chomp($yestdate); @delhosts=`mysql -e "select hostname,uuid,deleted_at from nova.instances where deleted_at is not null"|grep $yestdate`; foreach $delhost (@delhosts) { ($hostname,$uuid) = split(/\s+/,$delhost); $uuid2 = $uuid; $uuid2 =~ s/-//g; @cmdout=`spacecmd -q system_details $hostname.schmaustech.com`; foreach $cmd (@cmdout) { chomp($cmd); if ($cmd =~ /$uuid2/) { $message = "Removing from satellite hostname: $hostname with UUID: $uuid...\n"; $cmdtmp = `logger $message`; $cmdtmp = `spacecmd -y -q system_delete $hostname.schmaustech.com`; } } } exit;
[root@ceph-mon ceph]# ceph-deploy install ceph-mon [ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf [ceph_deploy.cli][INFO ] Invoked (1.5.2): /usr/bin/ceph-deploy install ceph-mon [ceph_deploy.install][DEBUG ] Installing stable version firefly on cluster ceph hosts ceph-mon [ceph_deploy.install][DEBUG ] Detecting platform for host ceph-mon ... [ceph-mon][DEBUG ] connected to host: ceph-mon [ceph-mon][DEBUG ] detect platform information from remote host [ceph_deploy][ERROR ] UnsupportedPlatform: Platform is not supported:
/etc/redhat-release
$ vi /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@ceph-mon ceph]# ceph-deploy install ceph-mon [ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf [ceph_deploy.cli][INFO ] Invoked (1.5.2): /usr/bin/ceph-deploy install ceph-mon [ceph_deploy.install][DEBUG ] Installing stable version firefly on cluster ceph hosts ceph-mon [ceph_deploy.install][DEBUG ] Detecting platform for host ceph-mon ... [ceph-mon][DEBUG ] connected to host: ceph-mon [ceph-mon][DEBUG ] detect platform information from remote host [ceph-mon][DEBUG ] detect machine type [ceph_deploy.install][INFO ] Distro info: Red Hat Enterprise Linux Server 6.5 Santiago [ceph-mon][INFO ] installing ceph on ceph-mon [ceph-mon][INFO ] Running command: yum clean all
### Ignore SSL Cert Errors ###
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class IDontCarePolicy : ICertificatePolicy {
public IDontCarePolicy() {}
public bool CheckValidationResult(
ServicePoint sPoint, X509Certificate cert,
WebRequest wRequest, int certProb) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy
### Username & Password ###
$username = 'admin'
$upassword = 'password'
### Build Up Authentication String ###
$auth = $username + ':' + $upassword
$Encoded = [System.Text.Encoding]::UTF8.GetBytes($auth)
$EncodedPassword = [System.Convert]::ToBase64String($Encoded)
### Build Up HTTP Headers ###
$headers = @{}
#$headers."Accept" = "application/json"
$headers."Authorization"="Basic $($EncodedPassword)"
$headers."x-isi-ifs-target-type" = "container"
### Base HTTP URL ###
$baseurl = 'https://10.88.82.106:8080'
$resource = '/namespace/ifs/data/benz/schmaus101'
$url = $baseurl + $resource
### Run REST PUT to Create Directory ###
$dir = Invoke-RestMethod -Uri $url -Headers $headers -Method Put -ContentType "application/json"
use REST::Client;
use JSON;
use Data::Dumper;
use MIME::Base64;
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $username = 'admin';
my $password = 'password$';
my $headers = {Accept => 'application/json', Authorization => 'Basic ' . encode_base64($username . ':' . $password), 'x-isi-ifs-target-type' => 'container'};
my $client = REST::Client->new();
$client->getUseragent()->ssl_opts( SSL_verify_mode => 0 );
$client->setHost('https://10.88.82.106:8080');
$client->PUT('/namespace/ifs/data/schmaus8','schmaus8',$headers);
print $client->responseContent(). "\n"; ;
exit;
C:\TEMP>perl isi-file-create.pl C:\TEMP>
use REST::Client;
use JSON;
use Data::Dumper;
use MIME::Base64;
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $username = 'admin';
my $password = 'secret';
my $headers = {Accept => 'application/json', Authorization => 'Basic ' . encode_base64($username . ':' . $password), Content-type => 'application/json'};
my $client = REST::Client->new();
$client->getUseragent()->ssl_opts( SSL_verify_mode => 0 );
$client->setHost('https://10.88.82.106:8080');
$client->GET('/namespace/ifs/data/benz',$headers);
print $client->responseContent(). "\n"; ;
exit;
C:\TEMP>perl isi-file-list.pl
{"children":[{
"name" : "schmaus3"
}
,{
"name" : "schmaus1"
}
,{
"name" : "schmaus2"
}
]}
filer> priv set diag
Warning: These diagnostic commands are for use by NetApp
personnel only.
filer*> ic ?
Usage:
ic status
ic stats performance
ic stats error [ -v ]
ic ood
ic ood stats
ic ood stats performance show [ -v ] [nv_vi_|vi_if_]
ic ood status
ic ood stats error show
ic dumpq
ic nvthruput [-bwmsrndkc:g:] [-c count]
ic reset nic [0|1]
ic reset link
ic dump hw_stats
ic ifthruput [chan]
filer*> ic status
Link 0: up
Link 1: up
cfo_rv connection state : CONNECTED
cfo_rv nic used : 1
cfo_rv2 connection state : CONNECTED
cfo_rv2 nic used : 1
filer*> ic reset nic 0
filer>priv set advanced
filer*>registry walk options
#!/bin/bash