Greetings! My name is Alex Simpson and I am a Netcool/OMNIbus developer. I thought I would begin my SMC blogging career by talking about the Netcool/OMNIbus nco_postmsg utility that was first released with v7.3.0.
nco_postmsg is a simple command line tool that enables you to quickly and easily send data to a Netcool/OMNIbus ObjectServer. It was developed as an OMNIbus equivalent of the TEC EIF postemsg, postzmsg and posteifmsg tools that send data from the command line to a TEC server or EIF receiver. It is worth noting that nco_postmsg doesn't use EIF itself, instead it communicates directly with an ObjectServer in the same manner as other OMNIbus clients such as nco_sql, the native event list and probes.
nco_postmsg accepts column name / value pairs as arguments and converts them to SQL insert statements which are then sent to an ObjectServer. It is really handy for sending stuff, either directly from the command line, or when executed by a a bash, perl or python script
Here's a command line example...
$OMNIHOME/bin/nco_postmsg “Identifier='test123'” “Severity=4” “Summary='Something has happened'”
The example above causes nco_postmsg to produce the following SQL statement and send it through to the NCOMS ObjectServer.
INSERT INTO alerts.status (Identifier,Severity,Summary,FirstOccurrence,LastOccurrence) VALUES ('test123',4,'Something has happened',1327426122,1327426122);
Notice that the FirstOccurence and LastOccurence fields are populated automatically.
You can configure connection properties within a props file, which then frees up the command line for the column name / value pairs you wish to send to the ObjectServer.
Here's a props file snippet containing the essential properties.
UserName: 'bert' # STRING (User to connect as)
Password: 'sesame' # STRING (Password for user)
Server: 'NCOMS' # STRING (Server to connect to)
Table: 'alerts.status' # STRING (Table to insert event)
nco_postmsg also features a rudimentary cache file that it can use if the connection to the ObjectServer is down. nco_postmsg will send data in the cache file to a single ObjectServer the next time the tool is run. If the cache file is not required then it can be turned off by setting the MaxCacheFileSize property to 0.
Here are some usage scenarios that I can think of...
- Sending the results of a process to an ObjectServer i.e. cron job, bash, perl or python script.
- Triggering functionality in the ObjectServer. For example, to turn on maintenance mode or to cause the ObjectServer to fire an external procedure.
- Used in conjunction with Accelerated Event Notification nco_postmsg can insert an event that is displayed as a pop-up on the screens of AEN channel subscribers
Documentation for nco_postmsg can be found here
I think nco_postmsg is a really useful tool in its current incarnation. However there is always room for improvement! If you have any suggestions then feel free to record them via the IBM RFE community.
Thanks for reading,