Zabbix - Set a group on top of System Status, without renaming - zabbix

I'm using Zabbix 3.0.1.
Image:
http://imgur.com/a/CEGju
Goal: To place one host group above all the others for Dashboard -> System Status -> Host Group.
In this case a host group is named 1_bravo_cloud.
But I'd like to have it named bravo_cloud without having it renamed to 1_bravo_cloud, in order to be on the top. The sorting is done in alphabetical order.
How is this possible, to have one host group above all the others to see the System Status, without renaming?

Unfortunately, there is no built-in way to do that. Sorting will always be alphabetic.

Related

MySQL JOIN with two tables and using IFNULL. Results vary between MySQL versions

I have 3 tables:
color: fixed list of original color names and their HEX.
store_color: custom color names (optional). For example if you want the color red to be call "deadpool red"
store_product_color: colors associated to a specific product ID.
This is the query causing the issue:
SELECT
store_product_color.id AS id,
store_product_color.id_color AS id_color,
color.hex AS hex,
IFNULL(store_color.name, color.name) AS name
FROM store_product_color
JOIN color ON color.id_color = store_product_color.id_color
LEFT JOIN store_color ON store_color.id_color = store_product_color.id_color
WHERE store_product_color.id_product = 176
ORDER BY store_product_color.id_color
It returns the id of the product association (primary), the id of the color, the color hex, and if a custom name exists, it should be used, else, use the original color name.
The query works perfect in my dev environment:
MySQL 5.6.25
Here comes the tricky part. The production environment uses another version of MySQL and the results vary from the dev environment. Instead of choosing between the custom and original color name, it creates 2 different rows, one for each name.
MySQL 5.6.30
I also tried removing IFNULL(store_color.name, color.name) AS name and adding store_color.name AS name2, color.name AS name1 but the issue remains.
I was unable to replicate this issue in sqlfiddle or db-fiddle. I added a live example, but it works fine just like it does on my dev environment: https://www.db-fiddle.com/f/25J8Kh8m8GSoHzw9MUJ67M/2
What can be causing this issue and how do I solve it? Thanks!

Embedded google drive ordering

Can we sort google drive files to show the newest or last modified ones on the top ?? I only can see the list and grid option for showing files in iframe. If not , any advice or alternative solution for this issue that my client is facing it ?
Here is the documentation you needed to list files from the drive.
This method accepts the q parameter, which is a search query combining
one or more search terms. For more information, see the Search for
Files and Team Drives guide.
And you can actually sort it by using the parameter orderBy.
A comma-separated list of sort keys. Valid keys are 'createdTime',
'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural',
'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and
'viewedByMeTime'. Each key sorts ascending by default, but may be
reversed with the 'desc' modifier. Example usage:
?orderBy=folder,modifiedTime desc,name. Please note that there is a
current limitation for users with approximately one million files in
which the requested sort order is ignored.
You can also test by Try it now.

Zabbix 2.2 calculate issue

I need to agregate power data from 8 different PDUs.
So far:
- I've created a template with OIDs to poll by SNMP the desired value and I called it: Amps Total.
- I've created 8 different hosts using the template and it works OK. I can see the Amps Total being graphed for all the devices.
- I've created a fake host to use as "Data Centre" object.
- I've created a new template with 8 items Type "Calculate", Formula:
last("PDU-B1-L:Amps Total")+last("PDU-B1-R:Amps Total")
(PDU-B1-L & PDU-B1-R are my PDU hostnames).
I was expecting to see the agregate data (at least for the 2 PDUs), but nothing is being shown. All the data type is Numeric (Unsigned).
Those hosts are being polled through a Zabbix proxy. I replaced the hostname by proxy:host:key in the formula with no luck. (the host config shows proxy:host as the hostname)
Any clue?
Thanks!
You have to use item keys in the calculated item formula. Given that spaces are not supported in item keys, "Amps Total" most likely is item name.

WordPress - MySQL Auto Increment User ID

I am looking to run two instances of WordPress which sync on a regular basis.
The way I am going to do this is to have the auto increment offset on each different.
So for example on instance one the user IDs would be 1,3,5,7 etc. And on instance two the user IDs would be 2,4,6,8 etc.
Within WordPress there is the user function wp_insert_user which I would like to add a filter to for the database insert of a new user.
The issue is I cannot see a filter directly before or relating to the insert. So I am stuck on how I would achieve this.
The function is found in wp-includes\user.php file on line 1856 and within that on line 2060 is the insert statement for a new user:
$wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) );
$user_id = (int) $wpdb->insert_id;
Could someone assist please? I just need pointing in the right direction as like I say I am not sure of the direction I need to take but want to ensure that the code I use is per the WordPress framework.
Configure this in MySQL directly. I assume you are going to sync all tables, in which case you might want to always increment by two. You can change the global auto_increment interval with auto_increment_increment:
SET GLOBAL auto_increment_increment=2;
Then configure each instance to have a different auto_increment_offset:
SET GLOBAL auto_increment_offset=1;
SET GLOBAL auto_increment_offset=2;

What should be the appropriate name of a log file

I want to log my exceptions in a file. What will be the name of the file?
Error-ddmmyyyy.log
Log-ddmmyyyy.err
Log-ddmmyyyy.txt
or anything else?
If date is important, I would use yyyymmdd format: this is easier to get a sorted list. I would add hhmmss if relevant.
.log suffix is nice for me.
I would add the name of the command issuing exceptions as a prefix of the logfile.
Something like: myCommand-20100315-114235.log
There are many ways you can name your log files, you have to consider several factors:
Is your file generated by a special server or application in a group? Then you should add the name of the server to know where it does come from.
Example:
Server1.log
In the log file there could be many levels of logging, if you want you can configure different files for different levels.
Example
Server1.info.log
Server1.err.log
You should add a date if your application runs for many days or if you want to keep track of errors for future reference, add it at the start of the name in yyyyMMdd format on windows or linux so they will be sorted by date automatically in command line commands or add it at the end if you want them more organized:
Server1.info.log.20100315 (Linux)
Server1.info.20100315.log (Win)
You can try with different combinations, it all depends on what sorting style and archiving style you want to achieve.