Serialnumber Default String

167 views
Skip to first unread message

Versie Rons

unread,
Jul 24, 2024, 10:17:06 AM7/24/24
to asarirleb

I have a specific computer model "GIGABYTE GB-BSi7-6500". For this computer model, I am getting serial number "default string" for chassis, baseboard, system & bios type. For uuid serial number type, I am getting alphanumeric value. The issue is that, we have more than 30 computers with same model. By default, Discovery is setting cmdb_ci_computer.serial_number to system serial number which is "default string".

So I created a new step(6. Copy of Insert serial number to cmdb_ci_computer) in Pattern "Windows OS - Desktops" to set the uuid as cmdb_ci_computer.serial_number for computer model "GIGABYTE GB-BSi7-6500". When I am running discovery, It shows uuid serial number in pattern log but on CI, it still shows "default string". Why it is still showing it while in pattern it shows uuid serial number.

serialnumber default string


Download File ===== https://bltlly.com/2zKB6a



Rather than customizing the pattern, it's better if you were to add in a new Invalid Serial Number [dscy_invalid_serial] to avoid this situation. The "Windows - Hardware Information" pattern filters out invalid serials before it sends them to "Insert serial number to cmdb_ci_computer".

I'm trying to process some data in Excel. The data includes numeric account numbers and other long numeric strings (like cell phone MEIDs). I am not doing math operations on these strings, so I want Excel to treat them as plain text.

The results remaining in scientific notation even though the cell is formatted as text just seems broken to me. I've seen suggested work-arounds like: use CSV import and set the format to text, add a space character to the beginning of each numeric string, and others.

Ah, memories of data munging back from when I did some massive number cross checking in Excel (never again).. When you punch in long numeric strings into Excel, try say, 12345678901234567890 (20 digits), Excel will generally convert it for you, meaning that the 20 digit number you've just tapped in has been cut back to be only about fifteen significant figures.

This occurs at point of entry, so once it's in, any additional detail is lost, and so even if you tell Excel that you really meant that was text, and not a number, you're kind of out of luck, and hence why your first sequence doesn't work.

A single apostrophe ' before a number will force Excel to treat a number as text (including a default left align). And if you have errors flagged, it will show as a number stored as text error on the cell.

I'm aware of the age of the question, but this is the one I've landed after google search and which did not answered my question (why formatting as text doesn't work and why number is cut down to 15 digits after format to text).

Short answer is: you can't work on your number the way you like AFTER you entered the numeric value and tapped Enter. The moment you do that the number will be truncated to 15 digits and presented in as exponential.

So what happens is that Excel autodetects type of input and if it's a number then it has precision limit of 15 digits and, if cell is formatted with 'General' format, it's displayed as exponential if value has 12 digits or more.

I believe it has to do with shell integration of Excel with '.CSV' files - in order for Excel to open them properly, assumptions have to be made. It is how Excel works for as long as I'm using it - that is: since 2001 at least.

Anything you do after that will be using the truncated value, so no formatting trick will help.However, you can use the Text to columns option to convert exponential notation to text (Click on column header, click Text to data, then Delimited, Next, untick all delimiter boxes, Select Text in Column data format and then Finish) to have the values converted to text and immediately displayed as 15 digit number. But, it will be only 15 digits, so if you had longer number, rest is "lost" to precision limit.

In order to have the number in the spreadsheet exactly the way you typed it in you have to store it as text. So you have two ways of doing that, but they will work only BEFORE/DURING editing:

If you're using method 1 and it "sometimes doesn't work", then, sorry, you either do something wrong or you have some sort of autocorrect on (if you use apostrophe and large number >15 digits Excel treats it as a wrong value and flags cell with warning message, so this remark is not personal nor critique).

Other way to do it in bulk numbers is to import values from text file. I dare say it's the only way for most situations. And be sure to import the file, not just open it, as Excel treats csv type like it's native format and trims large numbers to 15 digits as a matter of course.

Now, to the last issue. If you enter large numerical value in Excel cell formatted as text it will still be displayed in scientific notation as long as the cell is not wide enough. It's annoying, but side effect of some Excel internal algorithms. Just make the cell wider and you'll see full value every time.

Excel 2010: This works one column at a time and not at all for a row. Select the column or subset of a column, from the Data tab select "Text to Columns", and jump right to "Finish." No more scientific notation.

Excel is frustrating for CSV/bulk data work like this. Work with LibreOffice if possible, it doesn't do this, that is, if you open the same sheet (.xlsx) in Libreoffice, the large 'numbers' which are actually strings are not displayed in scientific notation (which is an absurd decision by Excel). LibreOffice's file fidelity is great: open the same .xlsx in Excel again, and the scientific notation instantly "works" just like usual.

The way I deal with this is I always first paste all the data into excel and note all the columns that have scientific notation. Then I undo the paste, highlight all the columns I noted before (Ctrl-Click) and change format to text. After that I re-paste and all the scientific notations disappear.

I am trying to change the default value of a control (actually a group of controls but looping each one singularly) and allow the user to save said default value so that the build itself doesn't need to be re-built and republished each time this value changes, while not requiring the value to be changed each time the program is ran later on in the future.

The problem is that not every control is changed and some that are changed are not included in this "set" of controls to have their default value changed. For example, this save action could happen while the user has input a serial number string into another input text box. The solutions I've seen utilize the full VI "Default Vals.Make Curr Default" invoke node which of course would work great for the controls the user changed but it would then make this serial number the default for the input text control also, which is not desirable.

Thus I need a method to take a refnum of a specific control and set its default value to its current value programmatically. Obviously the user cannot right click the control on the front panel and set it to default because they are running a built and published .exe. (unless I'm wrong and this actually is an option). Right now I have an array of the validated and supported references to the controls I want to change the default value of, but no property or method node I can find in the list interacts with default values at all.

Surely if there is an option for me to graphically right click a single control and make its current value default (which has no effect on any other control) there should be a way to complete that same task programmatically?

You can't change the default value of a control in a built executable. You will need to explicitly save the values from the controls to a configuration file, then explicitly load them from a configuration file when the program starts.

So I'm gonna write a quick post about a function in JavaScript that I found really confusing for a long time - I guess no one satisfactorily explained to me what was going on, so it just looked like gibberish.

Honestly my brain looked at that and went... Huh?
Ultimately it really is not very difficult, but no one had properly explained to me why each piece of this does what it does. So I'm gonna lay it out.

Because it's comparing these elements as strings, not integers, "54" comes before "8" because it starts with "5". That's probably not what you were going for. Let's take another look at that fancy nonsense from above now:

The problem I had upon first seeing this was that I was trying to interpret this logically, reading the code on its face. I didn't realize this is a case of another built in method for JavaScript. The function is actually an optional parameter, called the compareFunction, that allows you to define an alternative sort order.

The magic is that by performing an operation (subtraction) on the numbers in question, JavaScript converts them to integers. So it receives "54" and 4 and returns 54 - 4. That's a positive number, so the sort method knows to put 4 first. If you wanted to sort in descending order, you could use this instead:

The output will be [2, 3, 4, 54, 6, 8, 846]. This happens because when you use just .sort(), it defaults to sorting elements as if they were strings, leading to an alphabetical order rather than a numerical one.

This post is for people who are looking to name their computers to it's serial number. The script can be run with a policy at recurring check-in. Obviously there are multiple ways to set the computer name and the jamf binary can do it as well.

We also change the name of the mounted Hard Drive. The MK is for Mac workstation (we call Windows OS WK...). It's a little ugly, I get, but it seems to handle where various file and storage formats, (fusion, APFS, JFHS, etc). It has started to fail on me recently with fusion drives, need to figure that out.

ff7609af8f
Reply all
Reply to author
Forward
0 new messages