tag:blogger.com,1999:blog-59493779492895630632024-03-05T09:55:22.406-05:00Arthur GressickArthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.comBlogger169125tag:blogger.com,1999:blog-5949377949289563063.post-44437988887683825802022-09-30T14:27:00.002-04:002022-09-30T14:27:15.686-04:00PIP3 install<p> On Ubuntu I just run the following command to install PIP3</p><p class="p1" style="background-color: rgba(0, 0, 0, 0.85); color: #f2f2f2; font-family: Monaco; font-size: 10px; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal; margin: 0px;"><span class="s1" style="font-variant-ligatures: no-common-ligatures;">sudo apt-get install python3-pip</span></p>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0tag:blogger.com,1999:blog-5949377949289563063.post-13249732937987834062022-09-30T14:20:00.005-04:002022-09-30T14:20:39.140-04:00MongoDB 5 on Raspberry Pi/Ubuntu 20.04<p>After a clean install of Ubuntu server 20.04 update the system Then I ran this</p><div>wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - </div><div><br /></div><div>Then I ran this</div><div><br /></div>echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse<div><br /></div><div>Then I updated the OS</div><div><br /></div><div>sudo apt-get update</div><div><br /></div><div>Then installed MongoDB 5</div><div><br /></div><div>sudo apt-get install -y mongodb-org</div>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0tag:blogger.com,1999:blog-5949377949289563063.post-32582707164621497312019-11-20T20:58:00.002-05:002019-11-20T21:01:41.818-05:00PHP7 and MongoDB sample scriptsNow that we have the server setup we need to get some samples for adding, removing and listing data from MongoDB using PHP7.
<h2>
Here is Listing information</h2>
<pre class="prettyprint">
// Manager Class
$manager = new MongoDB\Driver\Manager("
mongodb+srv://corpDB:PASSWORD@americas0-r85l0.gcp.mongodb.net/test?retryWrites=true&w=majority");
// Query Class
$query = new MongoDB\Driver\Query(array('runtime' => 25));
// Output of the executeQuery will be object of MongoDB\Driver\Cursor class
$cursor = $manager->executeQuery('sample_mflix.movies', $query);
// Convert cursor to Array and print result
print_r($cursor->toArray());
</pre>
Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Crestwood, KY 40014, USA38.3242355 -85.47245929999996938.2744125 -85.553140299999967 38.374058500000004 -85.39177829999997tag:blogger.com,1999:blog-5949377949289563063.post-36741589303708617392019-11-02T20:27:00.002-04:002019-11-04T00:41:10.631-05:00Ubuntu 19.10 Server configuring Apache2, PHP7, MongoDB, SFTPI am testing out MongoDB with PHP7 for a project and wanted to connect my local Intel NUC servers to the remote hosted MongoDB.com service. There isn't a lot of setup content on the internet so I figure I would share my setup using Ubuntu Linux and connecting to MongoDB hosted services.
<h2>Apache2</h2>
<pre class="prettyprint">apt-get install apache2 libapache2-mod-php7.3</pre>
Before we go any further here are some directories
<pre class="prettyprint">/etc/apache2 <-- Default location for config files.
/var/www/html <-- Default location for HTML pages</pre>
<h2>PHP 7.3</h2>
Now we can check the PHP version with the below and also make sure we install of the common and dev binaries
<pre class="prettyprint">php -v</pre>
Here was my output
<pre class="prettyprint">PHP 7.3.11-0ubuntu0.19.10.1 (cli) (built: Oct 24 2019 11:38:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.11-0ubuntu0.19.10.1, Copyright (c) 1999-2018, by Zend Technologies</pre>
Here are all of the extras I added for PHP7.3
<pre class="prettyprint">apt-get install php7.3 php7.3-dev php7.3-common</pre>
<h2>VSFTP - Not necessary for SFTP</h2>
I am going to use SFTP (FTP over SSH) but if you want to install VSFTP here is what you need to install. You can skip this section if you don't plan on using standard FTP.
<pre class="prettyprint">apt-get install vsftpd</pre>
I do need to create a user account in order to upload PHP documents. The command below will create the folder "php". After you create the user you will need to set the password with the second command.
<pre class="prettyprint">useradd -m -d /var/www/php webuser
passwd webuser</pre>
<h2>Modify Apache location</h2>
Now it is time to point apache server over to the new folder which we just created. We need to modify the site files
<pre class="prettyprint">cd /etc/apache2/sites-available/
cp 000-default.conf 000-php-project.conf</pre>
Now we need to modify the location to look for the files
<pre class="prettyprint">nano /etc/apache2/sites-available/000-php-project.conf</pre>
Change the location to the new folder
<pre class="prettyprint"> ServerAdmin webmaster@localhost
DocumentRoot /var/www/php</pre>
<h2>installing Mongo-PHP</h2>
<pre class="prettyprint">apt-get install php-mongodb</pre>
You can check your version of php mongodb
<pre class="prettyprint">php --ri mongodb</pre>
Here is what I got when I ran the command
<pre class="prettyprint">mongodb
MongoDB support => enabled
MongoDB extension version => 1.5.5
MongoDB extension stability => stable
libbson bundled version => 1.13.0
libmongoc bundled version => 1.13.0
libmongoc SSL => enabled
libmongoc SSL library => OpenSSL
libmongoc crypto => enabled
libmongoc crypto library => libcrypto
libmongoc crypto system profile => disabled
libmongoc SASL => enabled
libmongoc ICU => disabled
libmongoc compression => enabled
libmongoc compression snappy => disabled
libmongoc compression zlib => enabled
Directive => Local Value => Master Value
mongodb.debug => no value => no value</pre>
That should be all you need to get this running. I will post some PHP examples next. Stay tuned and look for the samples.Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Crestwood, KY 40014, USA38.3242355 -85.47245929999996938.2744125 -85.553140299999967 38.374058500000004 -85.39177829999997tag:blogger.com,1999:blog-5949377949289563063.post-25308321965941556802019-10-28T21:13:00.001-04:002019-10-28T21:13:35.949-04:00Ubuntu 19.10 Networking via TerminalI am building my test lab and wanted to install the latest version of Ubuntu 19.10. Things have changed a lot over the years, here are some new notes on how to set it up.
<pre class="prettyprint sh">cd /etc/netplan/
ls
</pre>
Here is the file I had in this folder
<pre class="prettyprint sh">50-cloud-init.yaml</pre>
Now we take a look at it using Nano (my favorite)
<pre class="prettyprint sh"># This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
eno1:
addresses:
- 192.168.1.21/24
gateway4: 192.168.1.254
nameservers:
addresses:
- 192.168.1.254
version: 2
</pre>
Now that we made the changes we need to restart the networking daemon
<pre class="prettyprint sh">sudo netplan apply</pre>
Now we can verify the changes
<pre class="prettyprint sh">ip a</pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Crestwood, KY 40014, USA38.3242355 -85.47245929999996938.2744125 -85.553140299999967 38.374058500000004 -85.39177829999997tag:blogger.com,1999:blog-5949377949289563063.post-86917051739236102282019-01-03T13:22:00.000-05:002019-09-25T19:55:45.137-04:00Raspberry Pi Zero W - Wireless Configuationcreate the file under "boot" folder<br />
<br />
wpa_supplicant.conf<br />
<br />
<pre class="prettyprint">country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="myNetwork"
psk=“myPassword”
}
</pre>
<br />
once booted it is in /etc/wpa_supplicant folder<br />
<br />
<br />
By default, the current version of Raspbian has SSH disabled. We're going to enable it here.
<br />
<br />
Create an empty file in the boot directory called ssh
<br />
<br />
Make sure that the file has no file extension, i.e. remove the .txt if you created the file by selecting New > Text File.
Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0tag:blogger.com,1999:blog-5949377949289563063.post-12119161312247097022018-06-27T11:32:00.000-04:002018-06-27T11:32:12.051-04:00NetApp Portset / Multi-PathingBefore we begin setting this up I recommend that your Windows system is updated and that you download the latest version of the NetApp Host Utilities. You can find this software package from https://mysupport.netapp.com and search in Software Download. Here is a snippet of what it looks like.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6YrKTiaLQbLsi4vpAysSwuptCD62-fOnJq0Kz8RG8Uu8zOvFFAMRO618irvw9EdWw3n4bJqBe1jnHmz2SqSYMVisCF3FQ71i5Kbud7aiyCEYzncU5DCImCWazHdmQde2xVGn4d-rBAw/s1600/HostUtilities.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="324" data-original-width="1392" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6YrKTiaLQbLsi4vpAysSwuptCD62-fOnJq0Kz8RG8Uu8zOvFFAMRO618irvw9EdWw3n4bJqBe1jnHmz2SqSYMVisCF3FQ71i5Kbud7aiyCEYzncU5DCImCWazHdmQde2xVGn4d-rBAw/s640/HostUtilities.PNG" width="640" /></a></div>
<br />
<br />
Let's begin, now log into System Manager on your FAS/AFF system. Navigate to the LUNs section and take a look at the initiator Groups as shown below:
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKYVOPK3B6KMmoDlIvf3HwU5lqwxklm5CJlhQm2BY4NZETUP3kdFPSjSFD5EUz0NHSmczq7_EtrdYiZOGRQBQVGGV1VEiBNBvAFLorE8tM1tRRFPxBepZfm57UTx_3XPqIlkkuVcGNPw/s1600/Initiators2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="808" data-original-width="1600" height="321" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKYVOPK3B6KMmoDlIvf3HwU5lqwxklm5CJlhQm2BY4NZETUP3kdFPSjSFD5EUz0NHSmczq7_EtrdYiZOGRQBQVGGV1VEiBNBvAFLorE8tM1tRRFPxBepZfm57UTx_3XPqIlkkuVcGNPw/s640/Initiators2.png" width="640" /></a></div>
<br />
From here you can see the list of initiators which are used for Fiber Channel connections. Now to add more physical connections click on Portsets are the top of the screen in the tab. As shown below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyhxclEkApWq4OsLKklC_8nQ6_Mzr_GgBssp4PHtSQRFgLz-xlpyPo-7vh5ut9seRHQVuefaQ75b9cELYYVgeYwZM1S-Y-zgqJlO8F_7oENvZ014NEDqa2Grp27UwYa9mQgFvpZQNgFQ/s1600/portsets3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="1600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyhxclEkApWq4OsLKklC_8nQ6_Mzr_GgBssp4PHtSQRFgLz-xlpyPo-7vh5ut9seRHQVuefaQ75b9cELYYVgeYwZM1S-Y-zgqJlO8F_7oENvZ014NEDqa2Grp27UwYa9mQgFvpZQNgFQ/s640/portsets3.png" width="640" /></a></div>
<br />
So once you click on Portset name then click on Edit. This will pop up a list of physical ports in the cluster. Select all of the ports you want to join the portset and click save. Make sure all of the physical ports have been zoned to hosts and controllers.<br />
<br />
Now we should check to make sure the Reporting node sees all of the ports we have just setup. To check this log into the NetApp cluster via SSH. Once logged into the system you will need to check via these commands. Please note that you will need to go into Diagnostic mode. Please use caution. This is none disruptive but typing the wrong commands may result in outage. Please note that [ ] are not needed, this is just for you to replace with your information.<br />
<br />
<pre><code>set d
lun mapping show -vserver [SVM_Name] -volume [Volume_Name] -fields reporting-nodes</code></pre>
<br />
The information should show all of the paths to the host. If we want to add more reporting nodes use the following command<br />
<br />
<pre><code>lun mapping add-reporting-nodes -vserver [SVM_Name] -volume [Volume_Name] -lun [LUN_Name] -igroup [iGroup_Name] -destination-aggregate [Aggregate_Name]</code></pre>
<br />
Now you can check with the same command above to make sure more have been added
<br />
<br />
<pre><code>lun mapping show -vserver [SVM_Name] -volume [Volume_Name] -fields reporting-nodes</code></pre>
<br />
Now to check to make and sure you have all of the nodes and paths, open Disk Management on the Windows Server connected to NetApp and rescan the Bus. You should see all of the paths now listed in the properties of the disk. Below is a screen shot, look at the MPIO.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdgrL7SgB7BIDmHZCkxZ0FPq8gwwXJlX3gNBM-AAgY0-q5A9_8ZlQQ8VnDLvVLhJZRD1t4i4gokO6nRT42UK4rbqhdfYskN9zXRq5Q4BhsK05p9g4wzwSK-fq-nMVSghB3szCHeHzQEA/s1600/DiskManagement2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="763" data-original-width="1077" height="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdgrL7SgB7BIDmHZCkxZ0FPq8gwwXJlX3gNBM-AAgY0-q5A9_8ZlQQ8VnDLvVLhJZRD1t4i4gokO6nRT42UK4rbqhdfYskN9zXRq5Q4BhsK05p9g4wzwSK-fq-nMVSghB3szCHeHzQEA/s640/DiskManagement2.png" width="640" /></a></div>
<br />Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0tag:blogger.com,1999:blog-5949377949289563063.post-25489104364020138332018-01-28T02:03:00.002-05:002018-01-28T02:04:22.191-05:00Console over SSH (ONTAP)Recently I was working with a customer and our Professional Services people as we were doing an upgrade. If you want to view the console over SSH all you have to do is log into the Storage Processor and then run a command:<br />
<pre><code>system console</code></pre>
Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Crestwood, KY 40014, USA38.3242355 -85.47245929999996938.2744125 -85.553140299999967 38.374058500000004 -85.39177829999997tag:blogger.com,1999:blog-5949377949289563063.post-62805438409621364412018-01-28T01:47:00.000-05:002018-01-28T01:51:26.808-05:00NetApp ONTAP installation (Clean)If you need to reset a NetApp FAS/AFF system back to the factory setting it is pretty easy. When you reboot the system connect to the console port on the controllers. Wait for the second "Ctrl-C" menu then press "Ctrl-C" to enter the menu below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ7b-93s5dyEWmgy451xd9CNBPAUGY7Q177h-BcOdTkT7L4maDO2584VSuCMmLKkfkPDrFfbRdAHNdDcuHHiRi8GK4MHjy9Jo-xRYYTmOBUIvwDnwwmRfIsONBvuLTjgBACfF2oBgXCQ/s1600/NetApp_Boot_Menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="529" data-original-width="1600" height="209" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ7b-93s5dyEWmgy451xd9CNBPAUGY7Q177h-BcOdTkT7L4maDO2584VSuCMmLKkfkPDrFfbRdAHNdDcuHHiRi8GK4MHjy9Jo-xRYYTmOBUIvwDnwwmRfIsONBvuLTjgBACfF2oBgXCQ/s640/NetApp_Boot_Menu.png" width="640" /></a></div>
<br />
From here you can enter option "4" to do a clean configuration and initialize all disks.<br />
<br />
NOTE: You should have both controllers on the same menu before proceeding with a full reset.<br />
<br />
Another great feature of this menu is the Option 7, this allows you to upgrade the ONTAP software on the controllers. Engineers have used this to down rev or upgrade systems prior to joining a cluster.Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Crestwood, KY 40014, USA38.3242355 -85.47245929999996938.2744125 -85.553140299999967 38.374058500000004 -85.39177829999997tag:blogger.com,1999:blog-5949377949289563063.post-87923188293359323132012-03-13T21:20:00.000-04:002018-01-21T01:50:00.623-05:00vFoglight Cisco UCS CartridgeHere is all of the code which you will need to get things running. I have stopped the development of this cartridge and turning it over to capable hands at Quest. Below are the files<br />
<br />
<a href="https://drive.google.com/file/d/1Fed2ZzZs7sqt2z-qwUTI9-xW7smbGNw8/view?usp=sharing">Cisco UCS Files</a>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-25719894651040390882012-03-13T21:18:00.000-04:002018-01-21T01:49:40.187-05:00vFoglight Alarms with Counts (Groovy Script)Using the script editor located in Administration > Tooling > Script Console. Best to go ahead and save these for running at a later date when you need them. This will give you all of the alarms in the system along with the number of times it has triggered.<br />
<pre><code>
alarmService = server.get("AlarmService")
currentAlarms = alarmService.getCurrentAlarms();
def alarms = [] as TreeMap;
def result = new StringBuilder();
for (currentAlarm in currentAlarms)
{
def alarmName = currentAlarm.getSourceName()
def alarmEntry = alarms[alarmName]
if(alarmEntry == null)
{
alarms[alarmName] = 1
}
else
{
alarms[alarmName] = alarmEntry + 1
}
}
for (alarm in alarms.entrySet())
{
result.append(alarm.getKey()).append(" ").append(alarm.getValue()).append("\n")
}
return result
</code></pre>
Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-81132050882545843082012-03-13T21:14:00.000-04:002018-01-19T21:16:37.538-05:00vFoglight Purge Stale Objects (Groovy Script)Using the script editor located in Administration > Tooling > Script Console. Best to go ahead and save these for running at a later date when you need them. On line "10" you can enter the number of days to go back to remove the script below will purge objects "30" days old. Also on line "17" you can show the items to purge instead of deleting them.<br />
<pre><code>
// Script Purpose: Remove Stale Objects from vFoglight Database
// Script Platform: Foglight Managment Servers running on Windows or Linux
// Script Created by: chris.walker@quest.com
// Script Last Updated: 10.13.2011
// Script Version: 11.10.13
// Please see PDF documentation that should have come with this script for usage information
// Note: The script formating was compressed to save page space in the PDF. Sorry this does make it harder to read.
// Modify the line below to change the number of days
staleDays='30';// Exmple: Deleted object with stale data that is older than "30" days
// Set these to 1 if you want to delete the stale data in the respected topology type list
// Set to 0 if you do not want to delete the data
VMWare=1; // VMWare Data
GPI=1; // Guest Process Investigation Data
OSTypes=1; // OS Topology Types Used by vFoglight - Physical Disk
// If you just want to view a list of object that should be purged change this flag to 0. Set to 1 to actually purge data
PurgeData=0;
// Following is a list of vFoglight Topology Objects that will be purged of stale data
VMwareList = ['VMWVirtualMachine', 'VMWVirtualMachineHostCPUs', 'VMWVirtualMachineMemory', 'VMWVirtualMachineHostNetwork', 'VMWVirtualMachineNetworkInterface', 'VMWVMDiskLayout', 'VMWVirtualCenter', 'VMWDatastore', 'VMWESXServer', 'VMWESXServerPhysicalDisk', 'VMWCluster', 'VMWDatacenter', 'VMWAgent', 'VMWVirtualMachineLogicalDisk', 'VMWVirtualMachineHostStorage', 'VMWSnapshot', 'VMWSnapshotDiskInfo', 'VMWSnapshotFolder', 'VMWResourcePool'];
// Following is a list of Guest Process Topology Objects that will be purged of stale data
GPIList=['GuestProcessModel', 'GuestProcessAgent', 'GuestProcessDefaultAgentConfig'];
// Following is a list of Physical Topology Objects that are used by vFoglight and will be purged of stale data
OSList=['Host', 'HostCPUs', 'HostNetwork', 'HostStorage', 'IPAddress', 'LogicalDisk', 'PhysicalDisk', 'Processor', 'NetworkInterface', 'Memory'];
// Function used to purge data
def purgeStale(TopoName, staleAge, Purge) {
def dataSvc = server.get("DataService");
def topSvc = server.get("TopologyService");
def objects = server.get("QueryService").queryTopologyObjects(TopoName);
def staleTime = System.currentTimeMillis() - (staleAge.toInteger() * 24 * 60 * 60 * 1000L);
def staleObjects = [];
objects.each({ if (it.lastUpdated.time < staleTime) staleObjects << it });
// Print stale Oject List to Log
print "Stale objects:";
for (obj in staleObjects) {
print obj.longName + " " + obj.lastUpdated;}
// Delete the objects if PurgeData Flag is set
if (Purge==1) {
def batchSize = 100;
def idx = 0;
while (idx < staleObjects.size()) {
def endPos = Math.min(idx + batchSize, staleObjects.size());
def batch = staleObjects.subList(idx, endPos);
topSvc.deleteObjects(new HashSet(batch));
idx = endPos;}
print "*** Successfully Purged: " + staleObjects.size() + " stale objects. ***";}
else {
print "*** No objects Purged (use PurgeData flage in script to actually purge objects) ***";
print "*** Number of Stale Objects Identified but not Purged: " + staleObjects.size() + " ***";}
}// End purgeStale Function
// Start of Code to loop through Topology Types
// Put info in the FMS Log File
print "** Start VFDelete-stale.groovy script v11.10.13 **";
// Purge Stale Data for Foglight VMWare Cartridge
if (VMWare==1) {
print "* Processing VMware Topology Objects"
// Loop through each of the Topology Types
for (Topo in VMwareList) {
print "Removing Stale Objects for Topology: " + Topo;
purgeStale(Topo, staleDays, PurgeData);}
}
// Purge Stale Data for Foglight Guest Process Investigation (GPI) Cartridge
if (GPI==1) {
print "* Processing GPI Topology Objects";
// Loop through each of the Topology Types
for (Topo in GPIList){
print "Removing Stale Objects for Topology: " + Topo;
purgeStale(Topo, staleDays, PurgeData);}
}
if (OSTypes==1){
print "* Processing OS Topology Objects";
// Loop through each of the Topology Types
for (Topo in OSList){
print "Removing Stale Objects for Topology: " + Topo;
purgeStale(Topo, staleDays, PurgeData);}
}
print "** Finished Run of VFDelete-stale.groovy script v11.10.13 **";
return "Done...";
</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-31158620253497586162012-03-13T21:10:00.000-04:002018-01-19T21:14:52.083-05:00vFoglight Purge Alarms (Groovy Script)Using the script editor located in Administration > Tooling > Script Console. Best to go ahead and save these for running at a later date when you need them. On line "4" you can enter the number of day to go back and delete. This script will only remove 10,000 alarms at a time so you might want to make a rule to prune down the alarms.<br />
<pre><code>
def alarmSvc = server.AlarmService;
def LOG = org.apache.log4j.Logger.getLogger("Alarm Purge Rule")
def now = new Date();
def cutoff = now - 180;
def Anchor = now - 2000;
def alarms = alarmSvc.getAlarms(Anchor, cutoff);
for (alarm in alarms) {
alarmSvc.purgeAlarm(alarm.getID());
}
LOG.info("Purged " + alarms.size() + " alarms older than " + cutoff);
return "Purged " + alarms.size() + " alarms older than " + cutoff;
</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-22633754623420673202012-03-13T21:07:00.000-04:002018-01-19T21:09:22.519-05:00vFoglight Count Alarms (Groovy Script)Using the script editor located in Administration > Tooling > Script Console. Best to go ahead and save these for running at a later date when you need them.<br />
<pre><code>
import groovy.sql.Sql;
import com.quest.nitro.service.util.JDBCHelper;
msg = new StringBuilder();
try{
sql = new Sql(JDBCHelper.getDataSource());
msg.append("Alarms Table Count: \n")
msg.append(sql.rows("select count(*) from alarm_alarm"));
}catch (Exception ex){
msg.append("Exception"+ex);
}
return msg.toString();
</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-14846071347072457872012-02-14T21:03:00.000-05:002018-01-19T21:05:02.166-05:00Ubuntu Sun Java installAs many of you have seen Ubuntu has begun to drop Oracle/Sun java for the for OpenJDK well if you need it here is how to install it.<br />
<pre><code>
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo update-alternatives --config java
</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com1Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-6337588758987198512012-02-03T20:45:00.000-05:002018-01-19T21:01:56.226-05:00vFoglight AlarmsI don't usually post videos on my site but this one helps users understand how to work with Rules and Alarms in the environment. I have a lot of other videos on my channel.<br />
<br />
<iframe src="http://www.youtube.com/embed/aqzg0GwgxrI" frameborder="0" width="420" height="315"></iframe>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-22965346737587243312011-11-18T01:34:00.000-05:002018-01-19T01:34:58.888-05:00UCS API Ruby ScriptYesterday I completed my first vFoglight Script Agent. There was nothing special about the entire process just making sure to do everything the right way. A colleague of mine was instrumental in getting the integrating with vFoglight. The script on the other hand I got working pretty easily. Ruby proved quite useful and I actually installed ruby on Windows and it worked like a charm. Here is the script I used in case anyone wants to dabble a bit.<br />
<br />
On windows I downloaded the windows installer (1.8.7-p352) - <a href="http://rubyinstaller.org/downloads/" target="_blank">http://rubyinstaller.org/downloads/</a>
After Ruby is install I loaded just one GEM
<pre><code>gem install rest-client</code></pre>
Here is the code for the script - ucsmblades.rb
<pre><code>#!/usr/bin/ruby -v
#
# Steve Chambers rough'n'ready RUCS script (Ruby UCS)
# No error checking or anything clever, just plain
# code to demonstrate how easy this is
#
require 'rubygems' # rest_client is a GEM addon, so need this to use it
require 'rest_client' # hides all the hard stuff for connecting to RESTful service
require 'rexml/document' # makes XML work dead easy
include REXML # means I don't have to put REXML:: before every Document class
# Login to UCS
# initiate.xml is simply the <aaaLogin /> code from page 2-2 of the UCS API pdf
ucsResp = RestClient.post 'http://192.168.1.123/nuova', File.read('initiate.xml'), :content_type => 'text/xml'
# Create an XML doc and parse it, especially taking out the cookie.
ucsLoginDoc = Document.new(ucsResp)
ucsLoginRoot = ucsLoginDoc.root
ucsCookie = ucsLoginRoot.attributes['outCookie']
#
# Now we've got a session and a cookie, the UCS XML API is at our disposal!
#
# The UCS XML-API has a powerful query system, so let's see the blades
computeBladesXML = '<configResolveClass cookie="' + ucsCookie + '" inHierarchical="false" classId="computeBlade"/>'
ucsResp = RestClient.post 'http://192.168.1.123/nuova', computeBladesXML, :content_type => 'text/xml'
# Create an XML doc out of ucsResp and parse it for stuff
ucsBladesDoc = Document.new(ucsResp)
#print out the results
ucsBladesDoc.elements.each("configResolveClass/outConfigs/*") {
|blade|
bladeName = blade.attributes["dn"]
bladePower = blade.attributes["operPower"]
bladeDiscovery = blade.attributes["discovery"]
bladeAssociated = blade.attributes["association"]
bladeState = blade.attributes["operState"]
bladeCheck = blade.attributes["checkPoint"]
bladeConnPath = blade.attributes["connPath"]
bladeConnStatus = blade.attributes["connStatus"]
bladeAvailability = blade.attributes["availability"]
bladeAdminState = blade.attributes["adminState"]
bladeSerial = blade.attributes["serial"]
#Location information
bladeChassis = blade.attributes["chassisId"]
bladeSlotID = blade.attributes["slotId"]
#Blade Inventory
bladeModel = blade.attributes["model"]
bladeTotMemory = blade.attributes["totalMemory"]
bladeMemory = blade.attributes["availableMemory"]
bladeAdaptors = blade.attributes["numOfAdaptors"]
bladeCpus = blade.attributes["numOfCpus"]
bladeCores = blade.attributes["numOfCores"]
bladeCoreEnabled = blade.attributes["numOfCoresEnabled"]
bladeNics = blade.attributes["numOfEthHostIfs"]
bladeFcs = blade.attributes["numOfFcHostIfs"]
bladeThreads = blade.attributes["numOfThreads"]
#Start to output
puts "TABLE "+ bladeSerial
puts "START_SAMPLE_PERIOD"
puts "BladeName.StringObservation.obs= " + bladeName
puts "BladeModel.StringObservation.obs= " + bladeModel
puts "BladeChassis.StringObservation.obs= " + bladeChassis
puts "BladeSlotID.StringObservation.obs= " + bladeSlotID
puts "BladeAdminState.StringObservation.obs= " + bladeAdminState
puts "BladeAvailability.StringObservation.obs= " + bladeAvailability
puts "BladeConnStatus.StringObservation.obs= " + bladeConnStatus
puts "BladeConnPath.StringObservation.obs= " + bladeConnPath
puts "BladeCheck.StringObservation.obs= " + bladeCheck
puts "BladeState.StringObservation.obs= " + bladeState
puts "BladeAssociated.StringObservation.obs= " + bladeAssociated
puts "BladeDiscovery.StringObservation.obs= " + bladeDiscovery
puts "BladePower.StringObservation.obs= " + bladePower
puts "BladeTotMemory:megabyte= " + bladeTotMemory
puts "BladeMemory:megabyte= " + bladeMemory
puts "BladeAdaptors:count= " + bladeAdaptors
puts "BladeCPUs:count= " + bladeCpus
puts "BladeCores:count= " + bladeCores
puts "BladeCoresEnabled:count= " + bladeCoreEnabled
puts "BladeNics:count= " + bladeNics
puts "BladeFcs:count= " + bladeFcs
puts "BladeThreads:count= " + bladeThreads
puts "END_SAMPLE_PERIOD"
puts "END_TABLE"
}
#end the output</code></pre>
Here is the code for the initiate.xml
<pre><code><aaaLogin
inName="admin"
inPassword="admin"/></code></pre>
Put everything in a folder and just run it from command line. Make sure and change the UCS address and username and password
<pre><code>ruby -W0 ucsmblades.rb</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-57415292004700331182011-11-06T01:30:00.000-04:002018-01-19T01:31:53.339-05:00Cisco UCS+Ruby+XML+API really coolI have been working on a Cisco UCS plugin for vFoglight and came across some excellent work from another person. If you are looking to do some work with UCS and Ruby I recommend starting here. I used some of this code to understand what is going on with XML parsing.<br />
<br />
<a href="http://viewyonder.com/2009/10/04/vmware-ubuntu-ruby-rest-xml-cisco-ucs-api/" target="_blank">http://viewyonder.com/2009/10/04/vmware-ubuntu-ruby-rest-xml-cisco-ucs-api/</a>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-36864612214662343322011-10-29T01:28:00.000-04:002018-01-19T01:30:20.573-05:00Linux SMB not showing up in Network NeighborhoodI recently had a problem with my Linux SMB server where it was not showing up in the Windows Networking. It caused a lot of problems with my Smart Televisions and Windows 7 Machines. Here is how I fixed this problems.<br />
<br />
Best to kick the services
<pre><code>/etc/init.d/smbd restart
/etc/init.d/nmbd restart</code></pre>
If that doesn't work check to make sure that the firewall didn't get enabled. Check your smb.conf files as well. Good luck.Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-7112458963537376362011-09-16T01:27:00.000-04:002018-01-19T01:28:00.475-05:00openSUSE VMware tools vSphere 5I just installed openSUSE 11.4 in vSphere 5 and wanted to use the latest tools. openSUSE comes with open source tools but that just isn't going to work for me. Here are some steps to get it done:<br />
<br />
Install some applications prior to installing the tools
<pre><code>zypper install gcc make kernel-devel kernel-syms</code></pre>
Once this is complete you can mount the tools DVD and then drag it to the desktop, unzip, then execute the installer to install everything. This should work as it took me 5 tries to get everything installed.Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-40299492890287736502011-09-16T01:24:00.000-04:002018-01-19T01:26:18.675-05:00zypper Package ManagerIf you are using openSUSE this is the package manager which is very similar to yum and apt-get. Here are some commands which should help from the command line.<br />
<br />
This will give you packages which have updates.
<pre><code>zypper list-updates</code></pre>
This will update all packages
<pre><code>zypper update</code></pre>
List all installed packages
<pre><code>rpm -qa</code></pre>
Check and update specific packages like httpd
<pre><code>zypper update httpd</code></pre>
Sample of searching for packages multiple line examples
<pre><code>zypper info {package-name}
zypper search httpd
zypper search perl*</code></pre>
This will install a package.
<pre><code>zypper install {package-name}</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-69958766729431629912011-09-16T01:21:00.000-04:002018-01-19T01:22:40.303-05:00yum Package ManagerI know apt-get like the back of my hand and here are a few commands to help with YUM.<br />
<br />
This will give you packages which have updates.
<pre><code>yum list updates</code></pre>
This will update all packages
<pre><code>yum update</code></pre>
List all installed packages
<pre><code>yum list installed</code></pre>
List all installed for specific packages like httpd
<pre><code>yum list installed httpd</code></pre>
Check and update specific packages like httpd
<pre><code>yum update httpd</code></pre>
Sample of searching for packages multiple line examples
<pre><code>yum list {package-name}
yum list httpd
yum list perl*</code></pre>
This will install a package.
<pre><code>yum install {package-name}</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-75897465551406311812011-09-16T01:19:00.000-04:002018-01-19T01:20:25.094-05:00RedHat/CentOS 6 NetworkingI am working on a project where I needed to install CentOS and get networking setup. Since RedHat is almost the exactly the same these should work on either. I will be working from the command line for all of the command and logged in as ROOT.<br />
<br />
There is a quick command that is pretty easy: (this bring up a nice menu system)
<pre><code>setup</code></pre>
You can also go right to the config files:
<pre><code>cd /etc/sysconfig/network-scripts
nano ifcfg-eth0</code></pre>
Here is the output from my DHCP enabled setup:
<pre><code>DEVICE=eth0
HWADDR=00:50:56:a1:15:d3
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=dhcp
DNS2=192.168.1.20
TYPE=Ethernet
DNS1=192.168.1.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes</code></pre>
Then you need to restart the network to pickup the settings.
<pre><code>/etc/init.d/network restart</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-51956980151583320222011-07-22T01:17:00.000-04:002018-01-19T01:18:11.158-05:00Mac OS X Lion User Library HiddenIf your like me you need access to the Users Library to find preferences and settings. It is a necessity for me. I was really surprised when it was not showing up on Lion. I navigated to it via command line but I wanted a quick GUI navigation. Here are some commands to run it you want to view the Library folder again.<br />
<br />
If you’d just like your ~/Library to be visible normally in the Finder, that’s easy too; just enter this command in Terminal:
<pre><code>chflags nohidden ~/Library</code></pre>
And if you wish to reverse that action, just repeat the command without no, as in:
<pre><code>chflags nohidden ~/Library</code></pre>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979tag:blogger.com,1999:blog-5949377949289563063.post-60538111834738835962011-07-21T01:15:00.000-04:002018-01-19T01:16:15.332-05:00Mac OS X Lion Clean Install DVDI always like to do a clean install of the Mac OS X when there is a new version so when I was told I had to download and install from the web I thought, "I am not going to do this!" So I dug into the application and found the install DMG inside the application.<br />
<br />
Find the Application once it completely installs in Applications. Then right click on the app and show package contents. Then navigate to <strong>Contents > SharedSupport</strong>. Now open Disk Utility and insert a DVD+/-R in your computer and burn the disc. Once finished reboot the computer holding down the option key while booting and it should let you choose the new DVD you just made. Enjoy!<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtgGEi_2m8_X1MhC8FoPnirWGtYGS95RvRriqtb-rqRCrdSRQqSeRRq3gcvqQOrMhnHeyeguHrmO94s1tuJKLX_cOYNw805yL4NPmTf855jjajhp2lhoefK4icvdIOFbyzXohanFkSZw/s1600/lion.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtgGEi_2m8_X1MhC8FoPnirWGtYGS95RvRriqtb-rqRCrdSRQqSeRRq3gcvqQOrMhnHeyeguHrmO94s1tuJKLX_cOYNw805yL4NPmTf855jjajhp2lhoefK4icvdIOFbyzXohanFkSZw/s1600/lion.png" data-original-width="300" data-original-height="239" /></a>Arthur Gressickhttp://www.blogger.com/profile/04904182329104431673noreply@blogger.com0Walton, KY 41094, USA38.875619400000012 -84.61022129999997838.826165400000015 -84.690902299999976 38.925073400000009 -84.529540299999979