Life of a Geek Admin

The Daily adventures of a true geek administrator

Life of a Geek Admin - The Daily adventures of a true geek administrator

Virtual Disk Servce Crash on Windows 2003 Issue

Recently been seeing popup errors on Windows 2003 R2 servers running Microsoft SQL 2005 running giving Virtual Disk Service errors. When looking at the event log there are Application errors showing event id 1000. In doing some research found KB949001which a hotfix for the very error.

This hotfix should only be applied to servers experiencing this issue and requires a reboot after applying. According to the article you could see several errors in the event log.

On a Windows Server 2003-based computer, Virtual Disk Service (VDS) experiences an access violation. Then, VDS crashes when the service tries to close. This issue typically occurs when VDS is running under a heavy load.

Additionally, the following events are logged in the Application log and in the System log:

Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: Date
Time: Time
User: N/A
Computer: Computer Name
Description: Faulting application vds.exe, version 5.2.3790.4139, faulting module ntdll.dll, version 5.2.3790.3959, fault address fault address
Event Type: Error
Event Source: Service Control Manager
Event Category: None
Event ID: 7034
Date: Date: Date
Time: Time
User: N/A
Computer: Computer Name
Description: The Virtual Disk Service terminated unexpectedly. It has done this number time(s).
 
Event Type: Error
Event Source: Virtual Disk Service
Event Category: None
Event ID: 1
Date: Date
Time: Time
User: N/A
Computer: Computer Name
Description: Unexpected failure. Error code: exception code
 
Event Type: Error
Event Source: VDS Basic Provider 1.0
Event Category: None
Event ID: 1
Date: Date
Time: Time
User: N/A Computer: Computer Name
Description: Unexpected failure. Error code: exception code
 
This problem occurs because of a timing issue between two threads in VDS.

VDS maintains a list of software providers. When VDS closes, it releases the reference to software provider objects first. If a disk layout notification message arrives when some objects are freed but when the list is not freed, VDS may access an invalid software provider object. An access violation occurs when VDS accesses this list.

 
After applying the hotfix and rebooting the servers and the errors stopped.

Installing OCS Inventory Part 3 (Linux Agent)

Welcome to part 3 of the series on Installing OCS Inventory NG. In this part of the series we will cover installing the UNIX Agent on CentOS 6 (RHEL 6.0 based).

Note: OCS Inventory NG Agent for Linux can only be installed locally and cannot be deployed using package manager.

Now let’s get started and download the agent from here.

For Linux / Unix these are the required modules.

PERL 5.8

  • Perl module XML::Simple
  • Perl module Compress::Zlib
  • Perl module Net::IP
  • Perl module LWP::UserAgent
  • Perl module Digest::MD5
  • Perl Module Net::SSLeay
  • Perl Module Mac::SysProfile is need on MacOSX

dmidecode
lspci on Linux and *BSD (pciutils package)
Make utility
C/C++ compiler like GNU GCC

Optional modules:

  • Perl module Proc::Daemon
  • Perl module Proc::PID::File if Proc::Daemon is installed
  • Perl module Net::SNMP
  • Perl module Nmap::Parser
  • Perl module Module::Install
  • Perl module Net::CUPS
  • Perl module perl-cpan

Nmap (v3.90 or superior)

Now that we know what we need for the installation, let’s get started in getting them installed. As noted in OCS Inventory Ng Part 1 we need to have the EPEL repository installed. If you do not have it installed you can do so by following the following instructions.
Go to http://http://fedoraproject.org/wiki/EPEL and download and install the EPEL release based on your distribution release. In this example we are running 6.0 release, so EL6 is the chosen package. After installing you are ready to proceed.

Open a terminal session and run the following command to install the prerequisites.

$  sudo yum install perl-XML-Simple perl-Compress-Zlib perl-Net-IP perl-libwww-perl perl-Digest-HAMC perl-Digest-SHA1 perl-Net-SSLeay
perl-Crypt-SSLeay perl-Net-SNMP perl-Proc-Daemon perl-Proc-PID-File pciutils smartmontools monitor-edid

We will also need build utilities as well

$ sudo yum groupinstall "Development Tools" # This will ensure that you have all the required tools for the build.
$ sudo yum install ncurses-devel # This is required to enable a make *config command to execute correctly.
$ sudo yum install qt-devel # This is only necessary if you wish to use make xconfig instead of make gconfig or make menuconfig.

Any dependencies needed will be downloaded and installed. Now we are ready to install the agent.

Change to the directory where you downloaded the agent an un-tar it and change into the directory.

$ tar –xvf Ocsinventory-Unix-Agent-2.0.1.tar.gz
$ cd Ocsinventory-Unix-Agent-2.0.1

No lets build and install it using perl

$ perl Makefile.pl

$ make

$ sudo make install

A check for PERL interpreter binary, C/C++ compiler and make utility is made during installation. If one of these components is not found, setup will stop.

Setup will check for:

  • dmidecode binary.
  • Compress::Zlib PERL module
  • XML::Simple PERL module
  • Net::IP PERL module
  • LWP::UserAgent PERL module
  • Digest::MD5 PERL module
  • Net::SSLeay PERL module

If not found, it will ask you if you wish to install it. Enter “y” or validate to enable install of required component. If you enter “n”, setup will stop here.

Configuration begin. Choice to configure agent now or later.

Unixagent1

Select the path of configuration file directory

Unixagent2

Validation to create the directory, and definition of OCS Inventory NG server address (IP address or hoshtname.domain)

You will then have to choose between 3 methods for generating inventory:

  1. http: computer is connected to the network and is able to reach the Communication server with HTTP protocol. USED BY DEFAULT
  2. https: computer is connected to the network and is able to reach the Communication server with HTTPS protocol. You have to configure SSL on your OCS Server and copy the SSL certificate on the agent directory to use this method
  3. local: computer is not connected to the network and inventory will be generated in a file to manually send to OCS Inventory NG operator. This option must be set manually in ocsinventory-agent.conf like this :
 local=/tmp

For two others methods :

 Syntax : http[s]://ocsinventory-ng-server[:port]/ocsinventory

Exemples :

ocsserver.domains.local

https://w.x.y.z

ocsserver.domains.local:1234

https://ocsserver.domains.local

Unixagent3

Choice to use or not apache auth, and possibility to define an administrative tag

Unixagent4

Choice to create or not a cron task, definition and validation of agent files directory

Unixagent5

Choice to remove or not the old agent version

Unixagent6

Choice to use or not software deployment feature, SNMP scans feature and send an inventory

Unixagent7

If Accountinfo file doesn’t exist, it will be created, and the inventory will be sent to the server

Unixagent8

Now we have a Windows and a Linux agent installed and they have both reported inventory to the management server. Next part we start exploring the interface and some of the features of OCS Inventory NG.

Installing GLPI

The description of GLPI according to their site is, GLPI is the Information Resource-Manager with an additional Administration- Interface. You can use it to build up a database with an inventory for your company (computer, software, printers…). It has enhanced functions to make the daily life for the administrators easier, like a job-tracking-system with mail-notification and methods to build a database with basic information about your network-topology.

The principal functionality of the application are :

  • The precise inventory of all the technical resources. All their characteristics will be stored in a database.
  • Management and the history of the maintenance actions and the bound procedures. This application is dynamic and is directly connected to the users who can post requests to the technicians. An interface thus authorizes the latter with if required preventing the service of maintenance and indexing a problem encountered with one of the technical resources to which they have access.

For this installation we will be installing the base modules and also the mass import feature to retrieve the data we already have in OCS Inventory NG from the network.

Installation of GLPI and its various modules is simple with RHEL 6 as the packages are in the repository. Open a terminal session on your server or an ssh session to your server and run the following command to start the installation. This will install GLPI 0.78-5 on the server and all the dependencies for the program.

$ sudo yum install –y glpi glpi-mass-ocs-import glpi-data-injection glpi-pdf

Now that we have it installed we need to create the glpi database and create an id “synchro” that will be used to synchronize the ocsweb and glpi databases and give access to ocsweb database for synchro id. Attach to the mysql database and run the following commands:

$ mysql -uroot -prootsecret
mysql> CREATE USER ‘glpi’@'%’ IDENTIFIED BY ‘glpipass’;
mysql> GRANT USAGE ON *.* TO ‘glpi’@'%’ IDENTIFIED BY ‘glpipass’;
mysql> CREATE DATABASE IF NOT EXISTS `glpi` ;
mysql> GRANT ALL PRIVILEGES ON `glpi`.* TO ‘glpi’@'%’;
mysql> CREATE USER ‘synchro’@'%’ IDENTIFIED BY ‘synchropass’;
mysql> GRANT USAGE ON *.* TO ‘synchro’@'%’ IDENTIFIED BY ‘synchropass’;
mysql> GRANT SELECT ON `ocsweb`.* TO ‘synchro’@'%’;
mysql> GRANT DELETE ON `ocsweb`.`deleted_equiv` TO ‘synchro’@'%’;
mysql> GRANT UPDATE (`CHECKSUM`) ON `ocsweb`.`hardware` TO ‘synchro’@'%’;
mysql> FLUSH PRIVILEGES;
mysql> exit

Connect to the application  http://localhost/glpi/ it will launch the configuration wizard.

  • select your language and : OK.
  • read and accept the license (GPL) : Continue
  • start the installation : Installation
  • step 0 : prerequisites check (must be ok with the RPM) : Continue
  • step 1 : enter the database connection parameters (localhost / glpi / glpipass: Continue
  • step 2 : select the glpi database and Continue
  • step 3 : write somewhere the administrator login and password (glpi/glpi): Continue
  • step 4 : also write the other account information : Use GLPI
  • Authenticate yourself with the new account : glpi/glpi

Congratulations you have a working GLPI installation.

Now that you have logged in you need to change the default passwords. Click Administration > Users and select glpi user and type in a new password and confirm for the user id.

Installing OCS Inventory NG Part 2

As we continue deploying OCS Inventory NG in our network we now must install the agents on our Windows and Linux systems. We at least need to get the agent installed on one Windows system to use the packaging system to deploy the packages. For this post we will just show how to install the agents. Let’s start with installation of a Windows agent.

Download the Windows agent from here and unzip the file. Once the file has been extracted, double-click on OCS-NG-Windows-Agent-Setup.exe to start the installation.

ocs_8

The installation wizard will start running, click next to move forward.

ocs_9

Click I Agree to agree to the license agreement.

ocs_10

Now we are at the choose components screen. We will leave the default selections that are selected for us and click next to continue.

ocs_11

Now we are prompted for the address or FQDN (Fully Quailified Domain Name) of the OCS Inventory NG Communication server. Enter in the correct value for your installation. This should look like http://your_OCS_server/ocsinventory. Leave the validate certificates box checked and click next.

ocs_12

Next we have choices for the agent itself. By default none of the boxes are checked. If this is good for you then, click next to continue on with the install. For our installation I have chosen to Do not register Systray applet and Immediately launch inventory boxes.

Next choose destination folder, “C:\Program Files\OCS Inventory Agent” by default (“C:\Program Files (x86)\OCS Inventory Agent” under Windows 64 bits), and click “Install” button.  The installation will progress and will bring up a Finish screen when complete. Click “Finish” button to close OCS inventory NG Agent Setup.

For verification that the system has logged in just open http://your_OCS_server/ocreports, click on the All Computers icon and the system should be in the table that is displayed.

ocs_13

Stay tuned for part 3 where we will cover installing the Linux agent.

Configure SNMP for RHEL 6

SNMP is a very powerful and useful tool to add to your Linux system. It is great for sending alerts to different monitoring systems like Nagios and many other great products. But first it needs to be installed and configured before you can put this under rated tool to work.

Install SNMP using yum, you will need net-snmp-utils, net-snmp, net-snmp-libs.

$ sudo yum install –y net-snmp-utils net-snmp net-snmp-libs

Now that we have snmp it is time to configure SNMP.

Edit file /etc/snmp/snmpd.conf using your favorite text editor, mine just happens to be vi.

$ sudo vi /etc/snmp/snmpd.conf

Change/Modify line(s) as follows:

Find following Line:

com2sec notConfigUser  default       public

Replace with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines:

com2sec local     localhost           public
com2sec mynet 192.168.1.0/24      public

Find and change the lines.

group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

Replace with:

group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         mynet
group MyROGroup v2c        mynet
group MyROGroup usm        mynet

Locate and change the following line.

view    systemview     included      system

Replace with.

view all    included  .1                               80

Locate and change the following line.

access  notConfigGroup “”      any       noauth    exact  systemview none none

Replace with.

access MyROGroup “”      any       noauth    exact  all    none   none
access MyRWGroup “”      any       noauth    exact  all    all    none

Locate and change the following lines.

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)

Replace with your credentials.

syslocation RHEL 6, Linux Server.
syscontact sysadmin <root@localhost>

Now let’s start your snmp server and test it.

Set the snmpd service to start on reboot or system start.

$ sudo  chkconfig snmpd on

Fire it up !!

$ sudo  service snmpd start

Test your snmp server

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

Installing OCS Inventory NG Part 1

With a small office and on a budget needed to find a way to manage our amassing computer equipment. Enter in OCS Inventory NG (Open Computer and Software Inventory Next Generation)

OCS Inventory NG is an application designed to help a network or system administrator keep track of the computers configuration and software that are installed on the network. OCS Inventory is also able to detect all active devices on your network, such as switch, router, network printer and unattended devices. As a bonus, it also includes package deployment and is expandable for the Enterprise.

Some of the many features are:

  • Powerful deployment system allowing to distribute software installation or scripts on computers without overloading the network.
    Web Administration Console
  • Multiple operating systems support, including Microsoft Windows, Linux, *BSD, Sun Solaris, IBM AIX, HP-UX, MacOS X.
  • 3-Tier architecture using current standards, HTTP/HTTPS protocol and XML data formatting.
  • Web service accessible through SOAP interface.
  • Plugins support through API.
  • Network scan
  • Synchronization with GLPI

For our network we will be installing OCS Inventory NG on a RHEL 6 server and agents installed on Windows and Linux servers and several NAS and Network devices to be discovered. Since we have a small network a single OCS Management server is all we will require to handle the duties.

The current version at the time of writing is 2.01 and there are several pieces to install. The main part on the server is OCS Inventory NG Server, the OCS Inventory NG Agents and OCS Inventory NG Tools. All can be downloaded from OCS Inventory NG Downloads page.

Install OCS Inventory NG Server

First step is to install OCS Inventory NG Server. There are 4 parts to the server which are Database Server (MySQL), Communication server, Administration console and Deployment server. All 4 components can be hosted on the same server or split onto separate servers, for our installation we are installing all 4 components on one server.

OCS Inventory NG Server requirements are:

  • Apache version 1.3.33 or higher / Apache version 2.0.46 or higher.
    • Mod_perl version 1.29 or higher.
    • Mod_php version 4.3.2 or higher.
  • PHP 4.3.2 or higher, with ZIP and GD support enabled.
  • PERL 5.6 or higher.
    • Perl module XML::Simple version 2.12 or higher.
    • Perl module Compress::Zlib version 1.33 or higher.
    • Perl module DBI version 1.40 or higher.
    • Perl module DBD::Mysql version 2.9004 or higher.
    • Perl module Apache::DBI version 0.93 or higher.
    • Perl module Net::IP version 1.21 or higher.
    • Perl module SOAP::Lite version 0.66 or higher (optional)
  • MySQL version 4.1.0 or higher with InnoDB engine active.
  • Make utility such as GNU make.

During the installation OCS will check and prompt if it sees any requirements missing.

Now we need to install the requirements in which some of the requirements will need EPEL repository available for installation. Follow the link to install and update your repos.

Now that we have our repositories in order we can install the Perl modules and packages needed. First install communication server required Perl modules.

$ sudo yum install perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Apache-DBI perl-Net-IP perl-SOAP-Lite mod_perl

Any dependencies will be installed after running the command.

Next piece is to install the Administration console required PHP modules.

$ sudo yum install –y php-common php-gd

Now lets start the installation of OCS Inventory NG Server module.

Move the downloaded tar file to directory you want it to live, I have chosen /opt and un-tar it.

$ sudo cp OCSNG_UNIX_SERVER-2.0.1.tar.gz /opt/
$ cd /opt
$ sudo tar –xvzf OCSNG_UNIX_SERVER-2.0.1.tar.gz
$ cd OCSNG_UNIX_SERVER-2.0.1

Time to fire off the installation.

$sudo sh setup.sh

ocs_1

 

Type “y” or “enter” to validate and then enter in the MySQL server properties. If all is ok then enter in the MySQL port 3306, which is the default and press enter.

ocs_2

Enter in or validate the path to the Apache daemon binary, which is usually /usr/sbin/httpd.

Enter or validate the path to the Apache main configuration file, usually /etc/httpd/conf/httpd.conf

Enter or validate the Apache daemon running user account, which is apache for RedHat.

ocs_3

Enter in or validate the Apache include configuration directory, normally /etc/httpd/conf.d. Enter in or validate the location of Perl binaries, usually /usr/bin/perl.

Next the installation will attempt to determine the version of mod_perl running on the system. If installed it will move ahead, if there are multiple then it will ask what version you have, make the correct selection and move along. Next the installation will ask you where you want to store the debugging/tuning logs. Press enter to select the defaults. If all is ok, setup will install Communication Server.

Communicator server will complete and you will be prompted to install Administration console. Answer yes to proceed.

ocs_5

You will be prompted for location to install the PHP web console files and complete the installation.

Restart apache

$ sudo /etc/init.d/httpd restart

Configuring Communication server

Open a browser and go to http://localhost/ocsreports/install.php. This will open up the Administration server and ask for database connection properties for creating the MySQL database.

ocs_6

  • Fill in information to connect to MySQL database server with a user who has the ability to create database, tables, indexes, etc (usually root):
    MySQL user name
    MySQL user password
    MySQL hostname

Setup actions :

  • Create ocsweb database, and will add MySQL user ocs with password ocs.
  • Grant to user ocs privileges Select | Insert | Update | Delete | Create | Drop | References | Index | Alter | Create temp | Lock on database ocsweb.

Setup is now complete and you can login to http://localhost/ocsreports as user id admin and password admin. Once logged in change the password on the users section. You will also see a warning stating install.php exists in your installation directory.  Rename or delete /usr/share/ocsinventory-reports/ocsreports/install.php.

You will also see a warning to change the password for the ocs user created during the database configuration portion. Connect to your mysql instance and change the password for ocs user.

$ mysql –u root –p

mysql> set password for ‘ocs’@'localhost’ = PASSWORD(‘newpass’);
mysql> set password for ‘ocs’@'%’ = PASSWORD(‘newpass’);

Next the need to update the ocs user password in the database connection files. The first is the /usr/share/ocsinventory-reports/ocsreports/dbconfig.inc.php. Chane the define("PSWD_BASE","ocs"); line and save the file

Also need to change the PerlSetVar OCS_DB_PWD line in the /etc/httpd/conf.d/z-ocsinventory-server.conf file. Once the changes are completed restart apache. We now have a working installation.

ocs_7

Be looking for part 2 of the series where we will cover installing the Agents for Windows and Linux!!!

Switch to our mobile site