Separate MariaDB instances from mySQL instances in CMDB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 06:54 AM
Does anyone else out here separate MySQL database instances from MariaDB instances in the CMDB? Care to share any tips?
The issue we're having is that we originally set it up to take the Maria path if the install directory contains the text 'mariadb' but that, of course, depends on everyone in our organization following a standard install.
The 'better' way is to find the version. The version will always say 'mysql' or 'maria,' but I'm struggling with getting that command to be run before any further probes (or pattern) is run.
Thanks,
Drew
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 08:27 AM
So you can't do it in the classifier? For the running process that = a sql DB vs mariadb, does the running proc differ or something in the command or params?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 08:57 AM
The running process for both is mysqld. Nothing - zero - in the command or params distinguishes them, only the version results. Thanks developers! 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2019 09:19 AM
If there isn't something to distinguish between MariaDB and MySQL in the command line or command line options, then it's unlikely you'll be able to determine the difference before it's already classified as MySQL. ServiceNow's discovery grabs all the processes, then immediately passes them to process classifiers. I don't believe it's possible to insert extra commands in before this happens.
It sounds like you have a few options, all of which aren't necessarily reliable:
1.) As you suggested, implement an installation process that puts the database in a MariaDB folder of some kind (Seems like it's still the best answer) -- If your company is utilizing configuration management tools like ansible or puppet or some other type of automated build process, this might be easier to incorporate.
2.) Similar to 1, there might be a way to have the DBAs add some sort of tag in the command line options to indicate MariaDB, which you could then read.
3.) Disable the MySQL classifier and write your own probe or pattern that will hit every server and look for MariaDB and MySQL specifically, then create the appropriate CI. (This is probably the worst option, though, because it's highly customized)
4.) Modify the MySQL version sensor to force it to change the class of the CI. This might have a negative effect, though, of updating a CI in the MySQL table, then moving it to MariaDB table, every time you run discovery.
5.) You *might* be able to add the version command to the ADM multi-probe, but you'd need to run it on every server, regardless of if MariaDB was installed on it. That means that you'd also have to handle any errors received from running the command and having it fail so that you don't stop the rest of the multiprobe from continuing because of your version error. That data could be stored ok the ci results variable and could be referenced by your classifier, I think...
Last note -- If you're doing this to distinguish between the two for a configuration reason, then ignore the rest of this. If you're doing this for use in software asset management, you actually don't need to split them into their own table. Software asset management looks at install records rather than processes/applications and those records might indicate MariaDB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2019 01:12 PM
Servicenow has no plans to separate them out of box. You can vote for my Idea though -
https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=c2633a51dbfdc050feb1a851ca96...