Update your Hyper Host Server name as the SNMP location on a guest

 

This powershell script will get the HyperV Host server FQDN and save as a variable to input as the Location in the Location field of SNMP. Updates to the SNMP agent will require the agent to be restarted to take effect.

 

$VMHost
= (get-item
“HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).GetValue(“HostName”)

$SNMPAgent
=
“HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent”

Set-ItemProperty
-path
$SNMPAgent
-Name
sysLocation
-value
$VMHost.ToString()

 

 

Problems importing Name ACLs beginning with a number into IMC

Until recently I was stumped trying to import the ACLs off my 8206 Procurve (Aruba) switch into HP IMC using the ACL Devices function. The error I would receive was an Unknown Error and a Failed last poll result.

 

Ironically the issue was simple after trying to recreate the issue on another device. Once I moved an access-list that was named beginning with a number for example 879-in the ACL Management component would fail. By creating the same access-list on the Procurve as Vlan879-in the synchronization would turn to Succeeded.

This isn’t an issue on H3C product because all ACLs are numbered and naming is just for convienence.

Multiple Management Systems and Whatsup Gold

I recently came to the realization that I could be using the SQL backend systems of the different products I maintain to allow for additional insight into operations. As part of this I started to look at comparing my Whatsup Gold implementation with my HP IMC implementation. The systems fundamentally perform similar functions of management of the network but there is a basic difference WhatsUp Gold has the capability of taking a action as a result of a condition being met and IMC does not. Since I have been running two systems and periodically the two systems come out of sync with respect to whether a device is in one system or the other I took a look this morning and decided to start reporting against each database with respect to each other and came up with the query below. This query when used as a WhatsUp Gold Dynamic Group SQL query shows the devices that are listed in WhatsUp Gold but not in IMC.

—————-

SELECT DISTINCT WhatsUp15.dbo.Device.nDeviceID

 

 

FROM

 

WhatsUp15.dbo.MonitorState

INNER JOIN WhatsUp15.dbo.Device ON WhatsUp15.dbo.MonitorState.nMonitorStateID = WhatsUp15.dbo.Device.nWorstStateID

INNER JOIN WhatsUp15.dbo.DeviceType ON WhatsUp15.dbo.Device.nDeviceTypeID = WhatsUp15.dbo.DeviceType.nDeviceTypeID

FULL OUTER JOIN WhatsUp15.dbo.NetworkInterface ON WhatsUp15.dbo.Device.nDefaultNetworkInterfaceID = WhatsUp15.dbo.NetworkInterface.nNetworkInterfaceID

FULL OUTER JOIN config_db.imc_config.tbl_dev ON WhatsUp15.dbo.NetworkInterface.sNetworkAddress = config_db.imc_config.tbl_dev.dev_ip

 

 

WHERE

(NOT (WhatsUp15.dbo.NetworkInterface.sNetworkAddress = N’127.0.0.1′)) AND

(config_db.imc_config.tbl_dev.dev_ip IS NULL) AND

(NOT (WhatsUp15.dbo.MonitorState.nInternalMonitorState = 2)) AND

(NOT (WhatsUp15.dbo.DeviceType.sDisplayName LIKE N’%Windows%’)) AND

(WhatsUp15.dbo.NetworkInterface.bPollUsingNetworkName = 0)

 

 

 

—————–

This is based on my own environment with a shared SQL server and the IMC using config_db as a database and WhatsUp Gold using WhatsUp15 as a database. This could easily be accomplished by having linked servers in case of a split deployment.

The where clauses at the bottom do the following:

Statement 1: Ensure no loopback addresses are included

Statement 2: Ensure that the device doesn’t exist in IMC

Statement 3: Ensure the device is not in Maintenance mode in Whatsup Gold

Statement 4: Remove all devices that are Windows based ( I don’t monitor these with IMC)

Statement 5: Remove all devices that are polled using DNS name ( IMC doesn’t allow DNS resolution it only uses IP address once a device is created in the system)

 

I have included a diagram of the tables used and their relationships:

 

 

Creating a Vlan report from IMC in SQL

One of the issues in documentation is being able to leverage existing data stored in management systems. A good example of this is in the HP IMC product it can use SQL as a backend which allows for data to be pulled out is you know how to formulate the queries. Below is a example of the query to export all the VLANs IMC is aware of using two SQL views. The first view is a custom query specific to your environment and requires knowing you core L3 routing devices so that you can generate a report of only those devices Layer 3 routing ports in my case this is the four switches that have the device id’s of 1153, 1174, 1179, and 1278 in the database config_db and table tbl_dev.

—————————–

CREATE
VIEW [dbo].[vlaninfo_L3]

AS

SELECT
TOP (100) PERCENT vlan.tbl_vlan_virtual_if_info.vlan_id, vlan.tbl_vlan_overall_vlan.vlan_name, config_db.imc_config.tbl_snmp_sysinfo.sys_name,

vlan.tbl_vlan_virtual_if_info.ip_addr, vlan.tbl_vlan_virtual_if_info.ip_mask, vlan.tbl_vlan_overall_vlan.has_routing_port

FROM vlan.tbl_vlan_overall_vlan LEFT
OUTER
JOIN

vlan.tbl_vlan_virtual_if_info INNER
JOIN

config_db.imc_config.tbl_dev ON vlan.tbl_vlan_virtual_if_info.dev_id = config_db.imc_config.tbl_dev.dev_id INNER
JOIN

config_db.imc_config.tbl_snmp_sysinfo ON vlan.tbl_vlan_virtual_if_info.dev_id = config_db.imc_config.tbl_snmp_sysinfo.dev_id ON

vlan.tbl_vlan_overall_vlan.vlan_id = vlan.tbl_vlan_virtual_if_info.vlan_id

WHERE (config_db.imc_config.tbl_dev.dev_id = 1153)
OR


(config_db.imc_config.tbl_dev.dev_id = 1174)
OR


(config_db.imc_config.tbl_dev.dev_id = 1179)
OR


(config_db.imc_config.tbl_dev.dev_id = 1278)

ORDER
BY vlan.tbl_vlan_virtual_if_info.vlan_id

——————

 

 

The second SQL view is a union of all vlan information and the Layer 3 (routed vlan) information.

 

——————

SELECT vlan.tbl_vlan_overall_vlan.vlan_id AS Number, vlan.tbl_vlan_overall_vlan.vlan_name AS Name, vlan.tbl_vlan_overall_vlan.has_routing_port AS [Layer 3],

dbo.vlaninfo_L3.sys_name AS Switch, dbo.vlaninfo_L3.ip_addr AS [Default Gateway], dbo.vlaninfo_L3.ip_mask AS [Subnet Mask]

FROM dbo.vlaninfo_L3 RIGHT
OUTER
JOIN

vlan.tbl_vlan_overall_vlan ON dbo.vlaninfo_L3.vlan_id = vlan.tbl_vlan_overall_vlan.vlan_id

——————

 

 

 

 

 

 

For vlans with multiple default gateways it will show as multiple entries with the same vlan number.

 

SQL Report for Backup Tapes over last 24 hours

I was trying to find a report in Backup Exec to show me the tapes used in the last day or so for backups unfortunately I am running Backup Exec 2010 R3 and this feature is broken per http://www.symantec.com/docs/TECH52278 as a result I went digging into the SQL. Here is my query:

 

SELECT DISTINCT

TOP (100) PERCENT dbo.JobHistorySummary.JobName, dbo.fConvertDateTime(dbo.JobHistorySummary.OriginalStartTime) AS OriginalStartTime,

dbo.JobHistorySummary.IsJobActive, dbo.JobHistoryDetailInfo.Data

FROM dbo.JobHistoryDetail RIGHT OUTER JOIN

dbo.JobHistorySummary ON dbo.JobHistoryDetail.JobHistoryID = dbo.JobHistorySummary.JobHistoryID LEFT OUTER JOIN

dbo.JobHistoryDetailInfo ON dbo.JobHistoryDetail.JobHistoryDetailID = dbo.JobHistoryDetailInfo.JobHistoryDetailID CROSS JOIN

dbo.Media

WHERE (dbo.JobHistoryDetailInfo.Data IS NOT NULL) AND (dbo.JobHistorySummary.ActualStartTime > DATEADD(day, – 1, GETDATE())) AND

(dbo.JobHistorySummary.TaskTypeID = 200)

ORDER BY OriginalStartTime

 

 

I then placed it in a SharePoint webpage for quick access as a Data View Web Part:

Creating Multiple Moodle Certificates under one course

We have been rolling out an updated Moodle based training site and recently I was asked to be able to create multiple certificates within a single course. I found it fairly easy to modify /mod/certificate/type/A4_non_embeddded to reference the name of a certificate item in the course and get a matching certificate to the title. To make this change you should modify the certificate.php-file for the desired type in my case A4_non_embedded and replace “$course->fullname” with “$certificate->name”.

 

So the end result would look like the following highlighted line:

 

While I did play around with the idea of updating the underlying table with an additional column I didn’t think that it would be prudent and very likely to break in a future release.

Sentinel USB Dongles Local Website

I recently had a problem with a Sentinel USB dongle that was required for a piece of software to allow multiple users. You may have run into these before:

I found it very difficult to find out if the key was connected unless I went into the device manager in the system itself. I did find out that there is a local website on the system it is connected to that can tell you the status.

http://localhost:6002 or http://localhost:7002

The service that creates this website can be found under services:

 

And the website is unfortunately JAVA applet based so I can’t find a way to monitor effectively with WhatsUp Gold yet.

For more information about these please go to the manufacturer’s website http://sentinelcustomer.safenet-inc.com/

 

Backup your DHCP Database

One of the most important things you can do is backup your infrastructure servers. Obviously DHCP is a critical service without it many devices cease to function on a reboot. We have DHCP servers with multiple scopes defined to take care of different subnets on the network for IP [phones, wireless AP and clients and there can be a significant amount of configuaration and documentation required to restore that service when it is lost. In a crisis it is most important to get that service up and running as soon as possible without trying to restore the entire server from a backup.

DHCP is the lifeblood of a large network so backing it up should be important and not left to the simple backup of the domain controller. It is rather simple to backup from the management console by right clicking and choosing backup but this is far from automated and you still need to copy the file off the server to make it useful. There is a command line that can be used to complete this same task and even save the file to another server using the UNC path.

 

The best thing is to automate this process so I recommend using the Scheduled Task component under Group policy Preferences and applying it the OU your DHCP servers are in., within my environment that is the Domain Controllers OU.

The policy is rather simple:

A scheduled task under the Computer Configuration section

And schedule it to run daily be sure to add the domain computers group to have full controller over the share you are asking them to backup the file to. Since we didn’t specify a credential in the RUN AS section (there is good reason not to,  the password is stored in Active Directory and can be read)

 

 

 

 

 

HP WX Series FIT APs (formerly A-Series or H3C) Syslog Trick

I have found one of the main issues with FIT Aps on WX Controllers is the inability to monitor them effectively. I wish there was a way to monitor them with SNMP directly but it is disabled in most models. I have found that you can enable syslog via config file. I add a config file to all devices with a simple line below, this enable syslog to a server of IP 192.168.1.1.

 

Info-center loghost 192.168.1.1

 

To perform this create a text file of just this setting and upload it your controller via the webpage or tftp. Now under each configured AP add the file name I always add it under autoap config. In this example the file is called 7760config.txt.

 

The first thing I found out was that many of my FIT Aps were complaining (to themselves until I added the syslog) that the MAC-Address Table was full due to having too many VLANs trunked to the AP ports.