/opennms-base-assembly/src/main/filtered/etc/create.sql

https://github.com/ajakubo1/opennms · SQL · 2660 lines · 1209 code · 254 blank · 1197 comment · 1 complexity · 0a52967f0296d9fe4e220b03a6606906 MD5 · raw file

Large files are truncated click here to view the full file

  1. --# create.sql -- SQL to build the initial tables for the OpenNMS Project
  2. --#
  3. --# Modifications:
  4. --# 2013 Nov 15: Added protocol field in datalinkinterface table
  5. --# 2009 Sep 29: Added linkTypeId field in datalinkinterface table
  6. --# 2009 Mar 27: Added Users, Groups tables
  7. --# 2009 Jan 28: Added Acks tables - david@opennms.org
  8. --# 2007 Apr 10: Added statistics report tables - dj@opennms.org
  9. --# 2006 Apr 17: Added pathOutage table
  10. --# 2005 Mar 11: Added alarms table
  11. --# 2004 Aug 30: See create.sql.changes
  12. --#
  13. --# Copyright (C) 2005-2006 The OpenNMS Group, Inc., Inc. All rights reserved.
  14. --# Parts Copyright (C) 1999-2001 Oculan Corp. All rights reserved.
  15. --#
  16. --# This program is free software; you can redistribute it and/or modify
  17. --# it under the terms of the GNU General Public License as published by
  18. --# the Free Software Foundation; either version 2 of the License, or
  19. --# (at your option) any later version.
  20. --#
  21. --# This program is distributed in the hope that it will be useful,
  22. --# but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. --# GNU General Public License for more details.
  25. --#
  26. --# You should have received a copy of the GNU General Public License
  27. --# along with this program; if not, write to the Free Software
  28. --# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  29. --#
  30. --# For more information contact:
  31. --# OpenNMS Licensing <license@opennms.org>
  32. --# http://www.opennms.org/
  33. --# http://www.sortova.com/
  34. --#
  35. drop table accessLocks cascade;
  36. drop table accesspoints cascade;
  37. drop table category_node cascade;
  38. drop table categories cascade;
  39. drop table assets cascade;
  40. drop table usersNotified cascade;
  41. drop table notifications cascade;
  42. drop table outages cascade;
  43. drop table ifServices cascade;
  44. drop table snmpInterface cascade;
  45. drop table ipInterface cascade;
  46. drop table alarms cascade;
  47. drop table memos cascade;
  48. drop table node cascade;
  49. drop table service cascade;
  50. drop table distPoller cascade;
  51. drop table events cascade;
  52. drop table vulnerabilities cascade;
  53. drop table vulnPlugins cascade;
  54. drop table serverMap cascade;
  55. drop table serviceMap cascade;
  56. drop table pathOutage cascade;
  57. drop table demandPolls cascade;
  58. drop table pollResults cascade;
  59. drop table reportLocator cascade;
  60. drop table atinterface cascade;
  61. drop table stpnode cascade;
  62. drop table stpinterface cascade;
  63. drop table iprouteinterface cascade;
  64. drop table datalinkinterface cascade;
  65. drop table inventory cascade;
  66. drop table element cascade;
  67. drop table map cascade;
  68. drop table location_monitors cascade;
  69. drop table location_specific_status_changes cascade;
  70. drop table vlan cascade;
  71. drop table statisticsReportData cascade;
  72. drop table resourceReference cascade;
  73. drop table statisticsReport cascade;
  74. drop table acks cascade;
  75. drop table users cascade;
  76. drop table groups cascade;
  77. drop table group_user cascade;
  78. drop table category_user cascade;
  79. drop table category_group cascade;
  80. drop table filterfavorites cascade;
  81. drop sequence catNxtId;
  82. drop sequence nodeNxtId;
  83. drop sequence serviceNxtId;
  84. drop sequence eventsNxtId;
  85. drop sequence alarmsNxtId;
  86. drop sequence memoNxtId;
  87. drop sequence outageNxtId;
  88. drop sequence notifyNxtId;
  89. drop sequence userNotifNxtId;
  90. drop sequence demandPollNxtId;
  91. drop sequence pollResultNxtId;
  92. drop sequence vulnNxtId;
  93. drop sequence reportNxtId;
  94. drop sequence reportCatalogNxtId;
  95. drop sequence mapNxtId;
  96. drop sequence opennmsNxtId; --# should be used for all sequences, eventually
  97. drop sequence filternextid;
  98. drop index filternamesidx;
  99. --# Begin quartz persistence
  100. drop table qrtz_job_listeners;
  101. drop table qrtz_trigger_listeners;
  102. drop table qrtz_fired_triggers;
  103. drop table qrtz_paused_trigger_grps;
  104. drop table qrtz_scheduler_state;
  105. drop table qrtz_locks;
  106. drop table qrtz_simple_triggers;
  107. drop table qrtz_cron_triggers;
  108. drop table qrtz_blob_triggers;
  109. drop table qrtz_triggers;
  110. drop table qrtz_job_details;
  111. drop table qrtz_calendars;
  112. --# End quartz persistence
  113. CREATE FUNCTION plpgsql_call_handler ()
  114. RETURNS OPAQUE AS '$libdir/plpgsql.so' LANGUAGE 'c';
  115. CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
  116. HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL';
  117. --##################################################################
  118. --# The following commands set up automatic sequencing functionality
  119. --# for fields which require this.
  120. --#
  121. --# DO NOT forget to add an "install" comment so that the installer
  122. --# knows to fix and renumber the sequences if need be
  123. --##################################################################
  124. --# Sequence for the nodeID column in the aggregate_status_views and the
  125. --# aggregate_status_definitions tables (eventually all tables, perhaps)
  126. --# sequence, column, table
  127. --# install: opennmsNxtId id aggregate_status_views
  128. create sequence opennmsNxtId minvalue 1;
  129. --# Sequence for the nodeID column in the node table
  130. --# sequence, column, table
  131. --# install: nodeNxtId nodeID node
  132. create sequence nodeNxtId minvalue 1;
  133. --# Sequence for the serviceID column in the service table
  134. --# sequence, column, table
  135. --# install: serviceNxtId serviceID service
  136. create sequence serviceNxtId minvalue 1;
  137. --# Sequence for the eventID column in the events table
  138. --# sequence, column, table
  139. --# install: eventsNxtId eventID events
  140. create sequence eventsNxtId minvalue 1;
  141. --# Sequence for the alarmId column in the alarms table
  142. --# sequence, column, table
  143. --# install: alarmsNxtId alarmId alarms
  144. create sequence alarmsNxtId minvalue 1;
  145. --# Sequence for the id column in the memos table
  146. --# sequence, column, table
  147. --# install: memoNxtId id memos
  148. create sequence memoNxtId minvalue 1;
  149. --# Sequence for the outageID column in the outages table
  150. --# sequence, column, table
  151. --# install: outageNxtId outageID outages
  152. create sequence outageNxtId minvalue 1;
  153. --# Sequence for the notifyID column in the notification table
  154. --# sequence, column, table
  155. --# install: notifyNxtId notifyID notifications
  156. create sequence notifyNxtId minvalue 1;
  157. --# Sequence for the vulnerabilityID column in the vulnerabilities table
  158. --# sequence, column, table
  159. --# install: vulnNxtId vulnerabilityID vulnerabilities
  160. create sequence vulnNxtId minvalue 1;
  161. --# Sequence for the id column in the categories table
  162. --# sequence, column, table
  163. --# install: catNxtId categoryid categories
  164. create sequence catNxtId minvalue 1;
  165. --# Sequence for the id column in the usersNotified table
  166. --# sequence, column, table
  167. --# install: userNotifNxtId id usersNotified
  168. create sequence userNotifNxtId minvalue 1;
  169. --# Sequence for the id column in the demandPolls table
  170. --# sequence, column, table
  171. --# install: demandPollNxtId id demandPolls
  172. create sequence demandPollNxtId minvalue 1;
  173. --# Sequence for the id column in the pollResults table
  174. --# sequence, column, table
  175. --# install: pollResultNxtId id pollResults
  176. create sequence pollResultNxtId minvalue 1;
  177. --# Sequence for the mapID column in the map table
  178. --# sequence, column, table
  179. --# install: mapNxtId mapid map
  180. create sequence mapNxtId minvalue 1;
  181. --# Sequence for the filterid column in the filterfavorites table
  182. --# sequence, column, table
  183. --# install: filternextid filterid filterfavorites
  184. create sequence filternextid minvalue 1;
  185. --# A table to use to manage upsert access
  186. CREATE TABLE accessLocks (
  187. lockName varchar(40) not null,
  188. constraint pk_accessLocks PRIMARY KEY (lockName)
  189. );
  190. --#
  191. --########################################################################
  192. --# serverMap table - Contains a list of IP Addresses mapped to
  193. --# OpenNMS servers
  194. --#
  195. --# This table contains the following fields:
  196. --#
  197. --# ipAddr : IP address of the device to be monitored
  198. --# serverName : Text field to store the server name
  199. --#
  200. --########################################################################
  201. create table serverMap (
  202. ipAddr text not null,
  203. serverName varchar(64) not null );
  204. create index server_name_idx on serverMap(serverName);
  205. --########################################################################
  206. --# serviceMap table - Contains a list of IP Addresses mapped to
  207. --# OpenNMS services
  208. --#
  209. --# This table contains the following fields:
  210. --#
  211. --# ipAddr : IP address of the device to be monitored
  212. --# serviceName : Text field to store the service name
  213. --#
  214. --########################################################################
  215. create table serviceMap (
  216. ipAddr text not null,
  217. serviceMapName varchar(255) not null
  218. );
  219. create index servicemap_name_idx on serviceMap(serviceMapName);
  220. create index serviceMap_ipaddr_idx on serviceMap(ipAddr);
  221. --########################################################################
  222. --# distPoller table - Contains information on Distributed Pollers
  223. --# installed in this OpenNMS instance.
  224. --#
  225. --# This table contains the following fields:
  226. --#
  227. --# dpName : A human-readable name for each system. Typically,
  228. --# the system's hostname (not fully qualified).
  229. --# dpIP : IP address of the distributed poller.
  230. --# dpComment : Free-form text field
  231. --# dpDiscLimit : Numeric representation of percentage of interface speed
  232. --# available to discovery process. See documentation for
  233. --# "bandwidth troll"
  234. --# dpLastNodePull : Time of last pull of new nodes from the DP
  235. --# dpLastEventPull : Time of last pull of events from the DP
  236. --# dpLastPackagePush : Time of last push of Package (config) to the DP
  237. --# dpAdminState: Reflects desired state for this distributed poller.
  238. --# 1 = Up, 0 = Down
  239. --# dpRunState : Reflects the current perceived state of the distributed
  240. --# poller. 1 = Up, 0 = Down
  241. --#
  242. --########################################################################
  243. create table distPoller (
  244. dpName varchar(12) not null,
  245. dpIP text not null,
  246. dpComment varchar(256),
  247. dpDiscLimit numeric(5,2),
  248. dpLastNodePull timestamp with time zone,
  249. dpLastEventPull timestamp with time zone,
  250. dpLastPackagePush timestamp with time zone,
  251. dpAdminState integer,
  252. dpRunState integer,
  253. constraint pk_dpName primary key (dpName)
  254. );
  255. --########################################################################
  256. --# node Table - Contains information on nodes discovered and potentially
  257. --# managed by OpenNMS. nodeSys* fields map to SNMP MIB 2
  258. --# system table information.
  259. --#
  260. --# This table contains the following fields:
  261. --#
  262. --# nodeID : Unique identifier for node. Note that this is the
  263. --# enabler for overlapping IP ranges and that uniquity
  264. --# is dependent on combination of dpName & IP address
  265. --# dpName : Distributed Poller responsible for this node
  266. --# nodeCreateTime : Time node was added to the database
  267. --# nodeParentID : In the case that the node is virtual or an independent
  268. --# device in a chassis that should be reflected as a
  269. --# subcomponent or "child", this field reflects the nodeID
  270. --# of the chassis/physical node/"parent" device.
  271. --# Currently unused.
  272. --# nodeType : Flag indicating status of node
  273. --# 'A' - active
  274. --# 'D' - deleted
  275. --# nodeSysOID : SNMP MIB-2 system.sysObjectID.0
  276. --# nodeSysName : SNMP MIB-2 system.sysName.0
  277. --# nodeSysDescription : SNMP MIB-2 system.sysDescr.0
  278. --# nodeSysLocation : SNMP MIB-2 system.sysLocation.0
  279. --# nodeSysContact : SNMP MIB-2 system.sysContact.0
  280. --# nodeLabel : User-friendly name associated with the node.
  281. --# nodeLabelSource : Flag indicating source of nodeLabel
  282. --# 'U' = user defined
  283. --# 'H' = IP hostname
  284. --# 'S' = sysName
  285. --# 'A' = IP address
  286. --# nodeNetBIOSName : NetBIOS workstation name associated with the node.
  287. --# nodeDomainName : NetBIOS damain name associated with the node.
  288. --# operatingSystem : Operating system running on the node.
  289. --# lastCapsdPoll : Date and time of last Capsd scan.
  290. --# foreignSource : When importing nodes this contains the source of the
  291. --# nodes, null otherwise
  292. --# foriegnId : When importing nodes this contains the id of the node
  293. --# as known to the foriegn source, null otherwise
  294. --########################################################################
  295. create table node (
  296. nodeID integer not null,
  297. dpName varchar(12),
  298. nodeCreateTime timestamp with time zone not null,
  299. nodeParentID integer,
  300. nodeType char(1),
  301. nodeSysOID varchar(256),
  302. nodeSysName varchar(256),
  303. nodeSysDescription varchar(256),
  304. nodeSysLocation varchar(256),
  305. nodeSysContact varchar(256),
  306. nodeLabel varchar(256),
  307. nodeLabelSource char(1),
  308. nodeNetBIOSName varchar(16),
  309. nodeDomainName varchar(16),
  310. operatingSystem varchar(64),
  311. lastCapsdPoll timestamp with time zone,
  312. foreignSource varchar(64),
  313. foreignId varchar(64),
  314. constraint pk_nodeID primary key (nodeID),
  315. constraint fk_dpName foreign key (dpName) references distPoller
  316. );
  317. create index node_id_type_idx on node(nodeID, nodeType);
  318. create index node_label_idx on node(nodeLabel);
  319. create index node_dpname_idx on node(dpName);
  320. create unique index node_foreign_unique_idx on node(foreignSource, foreignId);
  321. --#########################################################################
  322. --# snmpInterface Table - Augments the ipInterface table with information
  323. --# available from IP interfaces which also support
  324. --# SNMP.
  325. --#
  326. --# This table provides the following information:
  327. --#
  328. --# nodeID : Unique identifier for node to which this if belongs
  329. --# snmpIpAdEntNetMask : SNMP MIB-2 ipAddrTable.ipAddrEntry.ipAdEntNetMask
  330. --# Value is interface's subnet mask
  331. --# snmpPhysAddr : SNMP MIB-2 ifTable.ifEntry.ifPhysAddress
  332. --# Value is interface's MAC Address
  333. --# snmpIfIndex : SNMP MIB-2 ifTable.ifEntry.ifIndex
  334. --# Value is interface's arbitrarily assigned index,
  335. --# or -100 if we can query the agent, but we can't find
  336. --# this IP address in the ifTable.
  337. --# snmpIfDescr : SNMP MIB-2 ifTable.ifEntry.ifDescr
  338. --# Value is interface's manufacturer/product name/version
  339. --# snmpIfType : SNMP MIB-2 ifTable.ifEntry.ifType
  340. --# Value is interface's physical/link protocol
  341. --# snmpIfName : SNMP MIB-2 ifTable.ifEntry.ifName
  342. --# Value is interface's device name
  343. --# snmpIfSpeed : SNMP MIB-2 ifTable.ifEntry.ifSpeed
  344. --# Value is estimate of interface's data rate
  345. --# snmpIfAdminStatus : SNMP MIB-2 ifTable.ifEntry.ifAdminStatus
  346. --# Value is interface's desired status
  347. --# 1 = Up, 2 = Down, 3 = Testing
  348. --# snmpIfOperStatus : SNMP MIB-2 ifTable.ifEntry.ifOperStatus
  349. --# Value is interface's current operational status
  350. --# 1 = Up, 2 = Down, 3 = Testing
  351. --# snmpIfAlias : SNMP MIB-2 ifXTable.ifXEntry.ifAlias
  352. --# Value is interface's device alias
  353. --# snmpCollect : 'C' means collect 'N' means don't collect
  354. --# : 'UC' means collect 'UN' means don't collect (user override)
  355. --# This has been moved from the isSnmpPrimary field in the
  356. --# ipinterface table
  357. --# snmpLastCapsdPoll : Date and time of last poll by capsd or provisiond
  358. --# snmpPoll : 'P' means polled 'N' means not polled (interface admin and oper status)
  359. --# snmpLastSnmpPoll : Date and time of last snmp poll
  360. --#
  361. --# NOTE: Although not marked as "not null" the snmpIfIndex field
  362. --# should never be null. This table is considered to be uniquely
  363. --# keyed by nodeId and snmpIfIndex. Eventually ipAddr and
  364. --# snmpIpAdEntNetMask will be removed and netmask added to
  365. --# the ipInterface table.
  366. --########################################################################
  367. create table snmpInterface (
  368. id INTEGER DEFAULT nextval('opennmsNxtId') NOT NULL,
  369. nodeID integer not null,
  370. snmpIpAdEntNetMask varchar(45),
  371. snmpPhysAddr varchar(32),
  372. snmpIfIndex integer not null,
  373. snmpIfDescr varchar(256),
  374. snmpIfType integer,
  375. snmpIfName varchar(96),
  376. snmpIfSpeed bigint,
  377. snmpIfAdminStatus integer,
  378. snmpIfOperStatus integer,
  379. snmpIfAlias varchar(256),
  380. snmpLastCapsdPoll timestamp with time zone,
  381. snmpCollect varchar(2) default 'N',
  382. snmpPoll varchar(1) default 'N',
  383. snmpLastSnmpPoll timestamp with time zone,
  384. CONSTRAINT snmpinterface_pkey primary key (id),
  385. constraint fk_nodeID2 foreign key (nodeID) references node ON DELETE CASCADE
  386. );
  387. create unique index snmpinterface_nodeid_ifindex_unique_idx on snmpinterface(nodeID, snmpIfIndex);
  388. create index snmpinterface_nodeid_idx on snmpinterface(nodeID);
  389. --########################################################################
  390. --# ipInterface Table - Contains information on interfaces which support
  391. --# TCP/IP as well as current status information.
  392. --# ipAddr is integer, to support easier filtering.
  393. --#
  394. --# This table contains the following information:
  395. --#
  396. --# nodeID : Unique identifier of the node that "owns" this interface
  397. --# ipAddr : IP Address associated with this interface
  398. --# ifIndex : SNMP index of interface, used to uniquely identify
  399. --# unnumbered interfaces, or null if there is no mapping to
  400. --# snmpInterface table. Can be -100 if old code added an
  401. --# snmpInterface table entry but no SNMP data could be gathered.
  402. --#
  403. --# NOTE: The combination of nodeID, ipAddr, and ifIndex must be unique,
  404. --# and this must be enforced programmatically.
  405. --#
  406. --# ipHostname : IP Hostname associated with this interface
  407. --# isManaged : Character used as a boolean flag
  408. --# 'M' - Managed
  409. --# 'A' - Alias
  410. --# 'D' - Deleted
  411. --# 'U' - Unmanaged
  412. --# 'F' - Forced Unmanaged (via the user interface)
  413. --# 'N' - Not polled as part of any package
  414. --# 'X' - Remotely Monitored only
  415. --# ipStatus : If interface supports SNMP this field will
  416. --# hold a numeric representation of interface's
  417. --# operational status (same as 'snmpIfOperStatus'
  418. --# field in the snmpInterface table).
  419. --# 1 = Up, 2 = Down, 3 = Testing
  420. --# ipLastCapsdPoll : Date and time of last poll by capsd or provisiond
  421. --# isSnmpPrimary : Character used as a boolean flag
  422. --# 'P' - Primary SNMP
  423. --# 'S' - Secondary SNMP
  424. --# 'N' - Not eligible (does not support SNMP or
  425. --# or has no ifIndex)
  426. --# NOTE: 'C' is no longer a valid value for isSnmpPrimary
  427. --# this has moved to the snmpinterface table
  428. --#
  429. --########################################################################
  430. create table ipInterface (
  431. id INTEGER DEFAULT nextval('opennmsNxtId') NOT NULL,
  432. nodeID integer not null,
  433. ipAddr text not null,
  434. ifIndex integer,
  435. ipHostname varchar(256),
  436. isManaged char(1),
  437. ipStatus integer,
  438. ipLastCapsdPoll timestamp with time zone,
  439. isSnmpPrimary char(1),
  440. snmpInterfaceId integer,
  441. CONSTRAINT ipinterface_pkey PRIMARY KEY (id),
  442. CONSTRAINT snmpinterface_fkey2 FOREIGN KEY (snmpInterfaceId) REFERENCES snmpInterface (id) ON DELETE SET NULL,
  443. constraint fk_nodeID1 foreign key (nodeID) references node ON DELETE CASCADE
  444. );
  445. create unique index ipinterface_nodeid_ipaddr_notzero_idx on ipInterface (nodeID, ipAddr) WHERE ipAddr != '0.0.0.0';
  446. create index ipinterface_nodeid_ipaddr_ismanaged_idx on ipInterface (nodeID, ipAddr, isManaged);
  447. create index ipinterface_ipaddr_ismanaged_idx on ipInterface (ipAddr, isManaged);
  448. create index ipinterface_ipaddr_idx on ipInterface (ipAddr);
  449. create index ipinterface_nodeid_ismanaged_idx on ipInterface (ipAddr);
  450. create index ipinterface_nodeid_idx on ipInterface (nodeID);
  451. create index ipinterface_snmpInterfaceId_idx on ipInterface (snmpInterfaceId);
  452. --########################################################################
  453. --# service Table - Contains a name<->number mapping for services
  454. --# (e.g., poller packages)
  455. --#
  456. --# This table provides the following information:
  457. --#
  458. --# serviceID : Unique integer mapping to service/poller package
  459. --# serviceName : Name associated with service/poller package
  460. --########################################################################
  461. create table service (
  462. serviceID integer default nextval('serviceNxtId') not null,
  463. serviceName varchar(255) not null,
  464. constraint pk_serviceID primary key (serviceID)
  465. );
  466. create unique index service_servicename_key on service (serviceid);
  467. --########################################################################
  468. --# ifServices Table - Contains a mapping of interfaces to services available
  469. --# on those interfaces (e.g., FTP, SMTP, DNS, etc.) and
  470. --# recent polling status information.
  471. --#
  472. --# This table provides the following information:
  473. --#
  474. --# nodeID : Unique integer identifier for node
  475. --# ipAddr : IP Address of node's interface
  476. --# ifIndex : SNMP ifIndex, if available, null otherwise
  477. --# serviceID : Unique integer identifier of service/poller package
  478. --# lastGood : Date and time of last successful poll by this poller package
  479. --# lastFail : Date and time of last failed poll by this poller package
  480. --# qualifier : Service qualifier. May be used to distinguish two
  481. --# services which have the same serviceID. For example, in the
  482. --# case of the HTTP service a qualifier might be the specific
  483. --# port on which the HTTP server was found.
  484. --# status : Flag indicating the status of the service.
  485. --# 'A' - Active
  486. --# 'D' - Deleted
  487. --# 'U' - Unmanaged (per capsd configuration change and CAPSD)
  488. --# 'F' - Forced unmanaged (via user interface)
  489. --# 'N' - Not polled as part of any of the packages that the
  490. --# interface belongs to
  491. --# 'X' - service is remotely monitored only
  492. --# source : Flag indicating how the service was detected.
  493. --# 'P' - Plugin
  494. --# 'F' - Forced (via CapsdPluginBehavior.conf)
  495. --# notify : Flag indicating if this service should be notified on or not
  496. --# 'Y' - to notify
  497. --# 'N' = not to notify
  498. --########################################################################
  499. create table ifServices (
  500. id integer default nextval('opennmsNxtId') NOT NULL,
  501. nodeID integer not null,
  502. ipAddr text not null,
  503. ifIndex integer,
  504. serviceID integer not null,
  505. lastGood timestamp with time zone,
  506. lastFail timestamp with time zone,
  507. qualifier char(16),
  508. status char(1),
  509. source char(1),
  510. notify char(1),
  511. ipInterfaceId integer not null,
  512. CONSTRAINT ifservices_pkey PRIMARY KEY (id),
  513. CONSTRAINT ipinterface_fkey FOREIGN KEY (ipInterfaceId) REFERENCES ipInterface (id) ON DELETE CASCADE,
  514. constraint fk_nodeID3 foreign key (nodeID) references node ON DELETE CASCADE,
  515. constraint fk_serviceID1 foreign key (serviceID) references service ON DELETE CASCADE
  516. );
  517. create unique index ifservices_nodeid_ipaddr_svc_unique on ifservices(nodeID, ipAddr, serviceId);
  518. create index ifservices_nodeid_ipaddr_status on ifservices(nodeID, ipAddr, status);
  519. create index ifservices_nodeid_status on ifservices(nodeid, status);
  520. create index ifservices_nodeid_idx on ifservices(nodeID);
  521. create index ifservices_serviceid_idx on ifservices(serviceID);
  522. create index ifservices_nodeid_serviceid_idx on ifservices(nodeID, serviceID);
  523. create index ifservicves_ipInterfaceId_idx on ifservices(ipInterfaceId);
  524. --##################################################################
  525. --# events Table -- This table provides information on the events
  526. --# that are passed into the event subsystem. It
  527. --# contains information defining the event as
  528. --# unique, while additional information is stored
  529. --# in the eventsDetail table.
  530. --#
  531. --# This table provides the following information:
  532. --#
  533. --# eventID : Unique identifier for the event
  534. --# eventUei : Universal Event Identifer (UEI) for this event
  535. --# eventSnmp : Contains the eid, eidtext (optionally), specific,
  536. --# and generic identifier for the SNMP Trap. This
  537. --# maps directly to the <snmp> element in the
  538. --# Event Data Stream DTD.
  539. --# eventTime : The <time> element from the Event Data Stream DTD,
  540. --# which is the time the event was received by the
  541. --# source process.
  542. --# eventCreateTime : Creation time of event in database
  543. --# eventHost : The <host> element from the Event Data Stream DTD
  544. --# eventSource : The entity/process which generated the event.
  545. --# eventSnmphost : The <snmphost> element from the Event Data Stream DTD
  546. --# eventDpName : The dpName of the Dist Poller which received the
  547. --# event
  548. --# eventParms : The <parms> element from the Event Data Stream DTD
  549. --# nodeID : Unique integer identifier for node
  550. --# ifindex : The <ifindex> element from the Event Data Stream DTD
  551. --# ipAddr : IP Address of node's interface
  552. --# serviceID : Unique integer identifier of service/poller package
  553. --# eventDescr : Free-form textual description of the event
  554. --# eventLogmsg : The log message for the event
  555. --# eventSeverity : Severity of event
  556. --# 1 = Indeterminate
  557. --# 2 = Cleared (implementation is now in alarms)
  558. --# 3 = Normal
  559. --# 4 = Warning
  560. --# 5 = Minor
  561. --# 6 = Major
  562. --# 7 = Critical
  563. --# eventPathOutage : Event Path outage information
  564. --# eventCorrelation : The event correlation configured for this event
  565. --# (stored as an XML string)
  566. --# eventSuppressedCount : The number of times the event was suppressed
  567. --# (if event correlation was set for suppression)
  568. --# eventOperInstruct : Operator instruction for event.
  569. --# eventAutoAction : Automated Action for event. Should
  570. --# consist of fully-qualfied pathname to
  571. --# executable command, with possible variables
  572. --# used to reference event-specific data
  573. --# eventOperAction : Operator Action for event. Should
  574. --# consist of fully-qualfied pathname to
  575. --# executable command, with possible variables
  576. --# used to reference event-specific data
  577. --# eventOperActionMenuText : Menu text displayed to Operator, which if
  578. --# selected, will invoke action described in
  579. --# eventOperAction
  580. --# eventLoggroup : Logical group with which to associate event.
  581. --# This field provides a means of logically
  582. --# grouping related events.
  583. --# eventNotification : Notification string. Should consist of
  584. --# a fully-qualfied pathname to an executable
  585. --# which invokes the notification software, and
  586. --# will likely contain event-specific variables
  587. --# eventTticket : Trouble ticket integration string. Should
  588. --# consist of fully-qualfied pathname to
  589. --# executable command, with possible variables
  590. --# used to reference event-specific data
  591. --# eventTticketState : Trouble ticket on/off boolean
  592. --# 1=on, 0=off
  593. --# eventForward : Contains a list of triplets:
  594. --# Destination,State,Mechanism;Destination,State,Mechanism;
  595. --# which reflect the following:
  596. --# - State is a boolean flag as to whether the
  597. --# entry is active or not. 1=on, 0=off.
  598. --# - Destination is hostname or IP of system to
  599. --# forward the event to
  600. --# - Method is the means by which it will be
  601. --# forwarded. A keyword, e.g., SNMP
  602. --# eventMouseOverText : Text to be displayed on MouseOver event, if
  603. --# the event is displayed in the browser and
  604. --# the operator needs additional info.
  605. --# eventLog : Flag indicating if the event is to be logged, set
  606. --# from the 'dest' attribute on the incoming event
  607. --# Y = log, N = do not log
  608. --# eventDisplay : Flag indicating if the event is to be displayed, set
  609. --# from the 'dest' attribute on the incoming event
  610. --# Y = display, N = do not display
  611. --# eventAckUser : The user who acknowledged this event. If
  612. --# null, then this event has not been acknowledged.
  613. --# eventAckTime : The time this event was acknowledged.
  614. --# alarmID : If this event is configured for alarmReduction, the alarmId
  615. --# of the reduced event will set in this column
  616. --#
  617. --##################################################################
  618. create table events (
  619. eventID integer not null,
  620. eventUei varchar(256) not null,
  621. nodeID integer,
  622. eventTime timestamp with time zone not null,
  623. eventHost varchar(256),
  624. eventSource varchar(128) not null,
  625. ipAddr text,
  626. eventDpName varchar(12) not null,
  627. eventSnmphost varchar(256),
  628. serviceID integer,
  629. eventSnmp varchar(256),
  630. eventParms text,
  631. eventCreateTime timestamp with time zone not null,
  632. eventDescr text,
  633. eventLoggroup varchar(32),
  634. eventLogmsg text,
  635. eventSeverity integer not null,
  636. eventPathOutage varchar(1024),
  637. eventCorrelation varchar(1024),
  638. eventSuppressedCount integer,
  639. eventOperInstruct varchar(1024),
  640. eventAutoAction varchar(256),
  641. eventOperAction varchar(256),
  642. eventOperActionMenuText varchar(64),
  643. eventNotification varchar(128),
  644. eventTticket varchar(128),
  645. eventTticketState integer,
  646. eventForward varchar(256),
  647. eventMouseOverText varchar(64),
  648. eventLog char(1) not null,
  649. eventDisplay char(1) not null,
  650. ifIndex integer,
  651. eventAckUser varchar(256),
  652. eventAckTime timestamp with time zone,
  653. alarmID integer,
  654. constraint pk_eventID primary key (eventID)
  655. );
  656. create index events_uei_idx on events(eventUei);
  657. create index events_nodeid_idx on events(nodeID);
  658. create index events_ipaddr_idx on events(ipaddr);
  659. create index events_serviceid_idx on events(serviceID);
  660. create index events_time_idx on events(eventTime);
  661. create index events_severity_idx on events(eventSeverity);
  662. create index events_log_idx on events(eventLog);
  663. create index events_display_idx on events(eventDisplay);
  664. create index events_ackuser_idx on events(eventAckUser);
  665. create index events_acktime_idx on events(eventAckTime);
  666. create index events_alarmid_idx on events(alarmID);
  667. create index events_nodeid_display_ackuser on events(nodeid, eventdisplay, eventackuser);
  668. --########################################################################
  669. --#
  670. --# outages table -- This table maintains a record of outage periods for
  671. --# given services on specific interfaces.
  672. --#
  673. --# This table provides the following information:
  674. --#
  675. --# outageID : Unique integer identifier for the outage
  676. --# svcLostEventID : ID of the event that caused the outage. Will be
  677. --# a non-null value when a new outage is inserted
  678. --# but might be null in case of an opennms upgrade
  679. --# svcRegainedEventID: ID of the event that cleared the outage
  680. --# nodeID : Unique integer identifier for node
  681. --# ipAddr : IP Address of node's interface
  682. --# serviceID : Unique integer identifier of service/poller package
  683. --# ifLostService : Time of lost service event
  684. --# ifRegainedService : Time of regained service event
  685. --# suppressTime : Time to suppress the outage
  686. --# suppressedBy : The suppressor
  687. --#
  688. --########################################################################
  689. create table outages (
  690. outageID integer not null,
  691. svcLostEventID integer,
  692. svcRegainedEventID integer,
  693. nodeID integer not null,
  694. ipAddr text not null,
  695. serviceID integer not null,
  696. ifLostService timestamp with time zone not null,
  697. ifRegainedService timestamp with time zone,
  698. suppressTime timestamp with time zone,
  699. suppressedBy varchar(256),
  700. ifServiceId INTEGER not null,
  701. constraint pk_outageID primary key (outageID),
  702. constraint fk_eventID1 foreign key (svcLostEventID) references events (eventID) ON DELETE CASCADE,
  703. constraint fk_eventID2 foreign key (svcRegainedEventID) references events (eventID) ON DELETE CASCADE,
  704. constraint fk_nodeID4 foreign key (nodeID) references node (nodeID) ON DELETE CASCADE,
  705. constraint fk_serviceID2 foreign key (serviceID) references service (serviceID) ON DELETE CASCADE,
  706. CONSTRAINT ifServices_fkey1 FOREIGN KEY (nodeId, ipAddr, serviceId) REFERENCES ifServices (nodeId, ipAddr, serviceId) ON DELETE CASCADE ON UPDATE CASCADE,
  707. CONSTRAINT ifServices_fkey2 FOREIGN KEY (ifServiceId) REFERENCES ifServices (id) ON DELETE CASCADE
  708. );
  709. create index outages_nodeid_ipaddr_svc_idx on outages(nodeID, ipAddr, serviceId);
  710. create index outages_svclostid_idx on outages(svcLostEventID);
  711. create index outages_svcregainedid_idx on outages(svcRegainedEventID);
  712. create index outages_nodeid_idx on outages(nodeID);
  713. create index outages_serviceid_idx on outages(serviceID);
  714. create index outages_ipaddr_idx on outages(ipaddr);
  715. create index outages_regainedservice_idx on outages(ifRegainedService);
  716. create index outages_ifServivceId_idx on outages(ifServiceId);
  717. --########################################################################
  718. --#
  719. --# vulnerabilities table -- This table maintains a record of vulnerabilites
  720. --# that have been detected on target IP addresses.
  721. --#
  722. --# This table provides the following information:
  723. --#
  724. --# vulnerabilityID : Unique integer identifier for the outage
  725. --# nodeID : Unique integer identifier for node
  726. --# ipAddr : IP Address of node's interface
  727. --# serviceID : Unique integer identifier of service/poller package
  728. --#
  729. --# creationTime : Initial creation time of the vulnerability
  730. --# lastAttemptTime : Last time that an attempt was made to scan for
  731. --# this vulnerability
  732. --# lastScanTime : Most recent successful scan time
  733. --# resolvedTime : Time after which the vulnerability was no longer
  734. --# detected
  735. --#
  736. --# severity : Severity of the vulnerability (identical to event
  737. --# severities
  738. --# pluginID : ID number of the plugin that produced the vulnerability
  739. --# pluginSubID : Specific vulnerability type generated by the plugin
  740. --# logmsg : Terse description of vulnerability (usually
  741. --# the plugin name plus short description)
  742. --# descr : Verbose description of vulnerability
  743. --# port : Port that the vulnerability affects
  744. --# protocol : Network protocol of the attack (TCP, UDP, ICMP)
  745. --#
  746. --########################################################################
  747. create table vulnerabilities (
  748. vulnerabilityID integer not null,
  749. nodeID integer,
  750. ipAddr text,
  751. serviceID integer,
  752. creationTime timestamp with time zone not null,
  753. lastAttemptTime timestamp with time zone not null,
  754. lastScanTime timestamp with time zone not null,
  755. resolvedTime timestamp with time zone,
  756. severity integer not null,
  757. pluginID integer not null,
  758. pluginSubID integer not null,
  759. logmsg text,
  760. descr text,
  761. port integer,
  762. protocol varchar(32),
  763. cveEntry varchar(255),
  764. constraint pk_vulnerabilityID primary key (vulnerabilityID)
  765. );
  766. create index vulnerabilities_nodeid_idx on vulnerabilities(nodeID);
  767. create index vulnerabilities_ipaddr_idx on vulnerabilities(ipAddr);
  768. create index vulnerabilities_severity_idx on vulnerabilities(severity);
  769. create index vulnerabilities_port_idx on vulnerabilities(port);
  770. create index vulnerabilities_protocol_idx on vulnerabilities(protocol);
  771. --########################################################################
  772. --#
  773. --# vulnPlugins table -- This table contains a list of information about
  774. --# Nessus plugins that are in use by the nessusd
  775. --# daemons that are being used by vulnscand.
  776. --#
  777. --# This table provides the following information:
  778. --#
  779. --# pluginID : Plugin ID number (from Nessus)
  780. --# pluginSubID : Specific vulnerability type within the plugin
  781. --# name : Short name of the plugin
  782. --# category : Category of the plugin's behavior (scanner,
  783. --# attack, etc)
  784. --# copyright : Copyright notice for the plugin
  785. --# descr : Verbose description of vulnerability
  786. --# summary : Short description of plugin behavior
  787. --# family : User-comprehensible type of attack (CGI abuses,
  788. --# Backdoors, etc)
  789. --# version : Version of the plugin code
  790. --# cveEntry : CVE entry associated with the vulnerability
  791. --# that this plugin tests
  792. --# md5 : 128-bit hex MD5 checksum of the plugin that
  793. --# can be used to detect changes in the plugin code
  794. --#
  795. --########################################################################
  796. create table vulnPlugins (
  797. pluginID integer not null,
  798. pluginSubID integer not null,
  799. name varchar(128),
  800. category varchar(32),
  801. copyright varchar(128),
  802. descr text,
  803. summary varchar(256),
  804. family varchar(32),
  805. version varchar(32),
  806. cveEntry varchar(255),
  807. md5 varchar(32)
  808. );
  809. --# This constraint not understood installer
  810. --# CONSTRAINT pk_vulnplugins PRIMARY KEY (pluginID,pluginSubID));
  811. --#
  812. create unique index vulnplugins_plugin_idx on vulnPlugins(pluginID, pluginSubID);
  813. --########################################################################
  814. --# notification table - Contains information on acknowleged and outstanding
  815. --# pages listed by user/groups
  816. --#
  817. --# This table contains the following fields:
  818. --#
  819. --# textMsg : The message being sent in the page.
  820. --# numericMsg : The message being sent to a numeric pager
  821. --# notifyID : The primary key of this row, populated with the value from
  822. --# the notifyNxtId sequence.
  823. --# pageTime : A timestamp of when the page was originally sent.
  824. --# respondTime : A timestamp of when the page was acknowleged. A null in this
  825. --# field means that the page has not been answered yet.
  826. --# answeredBy : The user id of the user that answered the page, set the same
  827. --# for all rows with the same groupId field.
  828. --# nodeId : The id of the node that has the problem
  829. --# interfaceId : The id of the interface on the node that has the problem
  830. --# serviceID : The id of the service on the interface that has the problem
  831. --# eventID : The primary key of the event that spawned the notification
  832. --# eventUEI : The uei of the event that spawned the notification, placed here
  833. --# for speed of lookup as notifications are processed.
  834. --#
  835. --########################################################################
  836. create table notifications (
  837. textMsg text not null,
  838. subject text,
  839. numericMsg varchar(256),
  840. notifyID integer not null,
  841. pageTime timestamp with time zone,
  842. respondTime timestamp with time zone,
  843. answeredBy varchar(256),
  844. nodeID integer,
  845. interfaceID varchar(16),
  846. serviceID integer,
  847. queueID varchar(256),
  848. eventID integer,
  849. eventUEI varchar(256) not null,
  850. notifConfigName varchar(63),
  851. constraint pk_notifyID primary key (notifyID),
  852. constraint fk_nodeID7 foreign key (nodeID) references node (nodeID) ON DELETE CASCADE,
  853. constraint fk_eventID3 foreign key (eventID) references events (eventID) ON DELETE CASCADE
  854. );
  855. create index notifications_nodeid_idx on notifications(nodeid);
  856. create index notifications_ipaddr_idx on notifications(interfaceID);
  857. create index notifications_serviceid_idx on notifications(serviceID);
  858. create index notifications_eventid_idx on notifications(eventID);
  859. create index notifications_respondtime_idx on notifications(respondTime);
  860. create index notifications_answeredby_idx on notifications(answeredBy);
  861. create index notifications_eventuei_idx on notifications (eventuei);
  862. --########################################################################
  863. --#
  864. --# This table contains the following fields:
  865. --# id : ID column for the table
  866. --# userID : The user id of the person being paged, from the users.xml
  867. --# file.
  868. --# notifyID : The index of the row from the notification table.
  869. --# notifyTime : The timestamp of when the notification was sent
  870. --# media : A string describing the type of contact being made, ie text
  871. --# page, numeric page, email, etc...
  872. --# contactInfo : A field for storing the information used to contact the user,
  873. --# e.g. an email address, the phone number and pin of the pager...
  874. --# autonotify : A character to determine how auto acknowledge is handled for
  875. --# this entry
  876. --#
  877. --########################################################################
  878. create table usersNotified (
  879. id integer not null,
  880. userID varchar(256) not null,
  881. notifyID integer,
  882. notifyTime timestamp with time zone,
  883. media varchar(32),
  884. contactinfo varchar(64),
  885. autonotify char(1),
  886. constraint pk_userNotificationID primary key (id),
  887. constraint fk_notifID2 foreign key (notifyID) references notifications (notifyID) ON DELETE CASCADE
  888. );
  889. create index userid_notifyid_idx on usersNotified(userID, notifyID);
  890. --#################################
  891. --# This table contains memos used by alarms to represent StickyMemos and Journal / ReductionKeyMemos
  892. create table memos (
  893. id integer NOT NULL,
  894. created timestamp with time zone,
  895. updated timestamp with time zone,
  896. author character varying(256),
  897. body text,
  898. reductionkey character varying(256),
  899. type character varying(64),
  900. CONSTRAINT memos_pkey PRIMARY KEY (id)
  901. );
  902. --########################################################################
  903. --#
  904. --# This table contains the following fields:
  905. --# alarmID : The id created from the alarmsNxtId sequence.
  906. --# eventUei : A reference to the eventUei that created this alarm.
  907. --# nodeID : A reference to the node represented by this alarm.
  908. --# ipAddr : IP Address of node's interface
  909. --# serviceID : A reference to the service represented by the alarm.
  910. --# reductionKey: Used with nodeID and serviceID to match an event and
  911. --# increment the counter column. Set by configuring the
  912. --# optional alarm-data elment in the eventConf.xml file.
  913. --# alarmType : Customizable column designed for use in automations and
  914. --# can be set in the eventConf.xml file by configuring the
  915. --# optional alarm-data element.
  916. --# counter : Incremented by the AlarmWriter instead of inserting
  917. --# a new row when matched node, service, and reductionKey
  918. --# severity : Severity of the Alarm... Initially set by the event
  919. --# can be changed with SQL update.
  920. --# lastEventID : A reference to the event table with the ID of the last
  921. --# matching event (typically node, service, reductionkey)
  922. --# firstEventTime: timestamp of the first event matching this alarm
  923. --# lastEventTime: timestamp of the last event matching this alarm
  924. --# description : description from the event
  925. --# logMsg : the logmsg from the event
  926. --# ifIndex : the ifindex from the event
  927. --# operInstruct: the operator instructions from the event
  928. --# tticketID : helpdesk integration field
  929. --# tticketState: helpdesk integration field
  930. --# mouseOverTest: flyOverText for the webUI
  931. --# suppressedUntil: used to suppress display an alarm until
  932. --# : timestamp time is reached
  933. --# suppressedUser : user that suppressed alarm
  934. --# suppressedTime : time the alarm was suppressed
  935. --# alarmAckUser : user that acknowledged the alarm
  936. --# alarmAckTime : time user Ack'd the alarm
  937. --# stickymemo : reference to the memo table
  938. --########################################################################
  939. create table alarms (
  940. alarmID INTEGER, CONSTRAINT pk_alarmID PRIMARY KEY (alarmID),
  941. eventUei VARCHAR(256) NOT NULL,
  942. dpName VARCHAR(12) NOT NULL,
  943. nodeID INTEGER, CONSTRAINT fk_alarms_nodeid FOREIGN KEY (nodeID) REFERENCES node (nodeID) ON DELETE CASCADE,
  944. ipaddr VARCHAR(39),
  945. serviceID INTEGER,
  946. reductionKey VARCHAR(256),
  947. alarmType INTEGER,
  948. counter INTEGER NOT NULL,
  949. severity INTEGER NOT NULL,
  950. lastEventID INTEGER, CONSTRAINT fk_eventIDak2 FOREIGN KEY (lastEventID) REFERENCES events (eventID) ON DELETE CASCADE,
  951. firstEventTime timestamp with time zone,
  952. lastEventTime timestamp with time zone,
  953. firstAutomationTime timestamp with time zone,
  954. lastAutomationTime timestamp with time zone,
  955. description text,
  956. logMsg text,
  957. operInstruct VARCHAR(1024),
  958. tticketID VARCHAR(128),
  959. tticketState INTEGER,
  960. mouseOverText VARCHAR(64),
  961. suppressedUntil timestamp with time zone,
  962. suppressedUser VARCHAR(256),
  963. suppressedTime timestamp with time zone,
  964. alarmAckUser VARCHAR(256),
  965. alarmAckTime timestamp with time zone,
  966. managedObjectInstance VARCHAR(512),
  967. managedObjectType VARCHAR(512),
  968. applicationDN VARCHAR(512),
  969. ossPrimaryKey VARCHAR(512),
  970. x733AlarmType VARCHAR(31),
  971. x733ProbableCause INTEGER default 0 not null,
  972. qosAlarmState VARCHAR(31),
  973. ifIndex INTEGER,
  974. clearKey VARCHAR(256),
  975. eventParms text,
  976. stickymemo INTEGER, CONSTRAINT fk_stickyMemo FOREIGN KEY (stickymemo) REFERENCES memos (id) ON DELETE CASCADE
  977. );
  978. CREATE INDEX alarm_uei_idx ON alarms(eventUei);
  979. CREATE INDEX alarm_nodeid_idx ON alarms(nodeID);
  980. CREATE UNIQUE INDEX alarm_reductionkey_idx ON alarms(reductionKey);
  981. CREATE INDEX alarm_clearkey_idx ON alarms(clearKey);
  982. CREATE INDEX alarm_reduction2_idx ON alarms(alarmID, eventUei, dpName, nodeID, serviceID, reductionKey);
  983. CREATE INDEX alarm_app_dn ON alarms(applicationDN);
  984. CREATE INDEX alarm_oss_primary_key ON alarms(ossPrimaryKey);
  985. CREATE INDEX alarm_eventid_idx ON alarms(lastEventID);
  986. CREATE INDEX alarm_lasteventtime_idx on alarms(lasteventtime);
  987. CREATE INDEX alarm_firstautomationtime_idx on alarms(firstautomationtime);
  988. CREATE INDEX alarm_lastautomationtime_idx on alarms(lastautomationtime);
  989. --########################################################################
  990. --#
  991. --# Use this table to add additional custom data about an alarm... somewhat
  992. --# usefull with automations and will be viewable/editable in the alarm
  993. --# details WebUI page.
  994. --#
  995. --# This table contains the following fields:
  996. --# alarmID : The id created from the alarmsNxtId sequence.
  997. --# attribute : The custom attribute name
  998. --# attributeValue : The custom attribute value
  999. --########################################################################
  1000. CREATE TABLE alarm_attributes (
  1001. alarmID INTEGER, CONSTRAINT fk_alarmID1 FOREIGN KEY (alarmID) REFERENCES alarms (alarmID) ON DELETE CASCADE,
  1002. attributeName VARCHAR(63),
  1003. attributeValue VARCHAR(255)
  1004. );
  1005. CREATE INDEX alarm_attributes_idx ON alarm_attributes(alarmID);
  1006. CREATE UNIQUE INDEX alarm_attributes_aan_idx ON alarm_attributes(alarmID, attributeName);
  1007. --# This constraint not understood by installer
  1008. --# CONSTRAINT pk_usersNotified PRIMARY KEY (userID,notifyID) );
  1009. --#
  1010. --########################################################################
  1011. --# asset table - Contains inventory and other user-entered information
  1012. --# for nodes
  1013. --#
  1014. --# This table contains the following fields:
  1015. --#
  1016. --# nodeID : The node id for the node this asset information belongs.
  1017. --# category : A broad idea of what this asset does (examples are
  1018. --# desktop, printer, server, infrastructure, etc.).
  1019. --# manufacturer : Name of the manufacturer of this asset.
  1020. --# vendor : Vendor from whom this asset was purchased.
  1021. --# modelNumber : The model number of this asset.
  1022. --# serialNumber : The serial number of this asset.
  1023. --# description : A free-form description.
  1024. --# circuitId : The electrical/network circuit this asset connects to.
  1025. --# assetNumber : A business-specified asset number.
  1026. --# operatingSystem : The operating system, if any.
  1027. --# rack : For servers, the rack it is installed in.
  1028. --# slot : For servers, the slot in the rack it is installed in.
  1029. --# port : For servers, the port in the slot it is installed in.
  1030. --# region : A broad geographical or organizational area.
  1031. --# division : A broad geographical or organizational area.
  1032. --# department : The department this asset belongs to.
  1033. --# address1 : Add